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


C# Obj_AI_Hero.GetAutoAttackDamage方法代码示例

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


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

示例1: GetHeroAvgDamage

        /// <summary>
        /// Gets the hero average damage to the opposing team.
        /// </summary>
        /// <param name="player">The player.</param>
        /// <param name="Enemies">The enemies.</param>
        /// <returns></returns>
        public static float GetHeroAvgDamage(Obj_AI_Hero player, List<Obj_AI_Hero> Enemies)
        {
            var totalEnemies = Enemies.Count();
            if (totalEnemies == 0)
            {
                return -1;
            }
            var AADamage = Enemies.Aggregate(0, (current, s) => (int) (current + player.GetAutoAttackDamage(s) * 2));
            var QDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.Q).IsReady() ? player.GetSpellDamage(s, SpellSlot.Q) : 0f)));
            var WDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.W).IsReady() ? player.GetSpellDamage(s, SpellSlot.W) : 0f)));
            var EDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.E).IsReady() ? player.GetSpellDamage(s, SpellSlot.E) : 0f)));
            var RDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.R).IsReady() ? player.GetSpellDamage(s, SpellSlot.R) : 0f)));
            
            var itemsDamage = 0f;

            foreach (var item in player.InventoryItems)
            {
                foreach (var hero in Enemies)
                {
                    var itemID = item.Id;
                    switch (itemID)
                    {
                        case ItemId.Bilgewater_Cutlass:
                            itemsDamage +=
                                (float) player.GetItemDamage(hero, Damage.DamageItems.Bilgewater);
                            break;
                        case ItemId.Blade_of_the_Ruined_King:
                            itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Botrk);
                            break;
                        case ItemId.Hextech_Gunblade:
                            itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Hexgun);
                            break;
                        case ItemId.Frost_Queens_Claim:
                            itemsDamage +=
                                (float) player.GetItemDamage(hero, Damage.DamageItems.FrostQueenClaim);
                            break;
                        case ItemId.Tiamat_Melee_Only:
                            itemsDamage += player.IsMelee
                                ? (float) player.GetItemDamage(hero, Damage.DamageItems.Tiamat)
                                : 0f;
                            break;
                        case ItemId.Ravenous_Hydra_Melee_Only:
                            itemsDamage += player.IsMelee
                                ? (float) player.GetItemDamage(hero, Damage.DamageItems.Hydra)
                                : 0f;
                            break;
                        case ItemId.Liandrys_Torment:
                            itemsDamage +=
                                (float) player.GetItemDamage(hero, Damage.DamageItems.LiandrysTorment);
                            break;
                    }
                }
                
            }

            var totalDamage = AADamage + QDamage + WDamage + EDamage + RDamage + itemsDamage;

            return (float) totalDamage / totalEnemies;
        }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:65,代码来源:TFHelperCalculator.cs

示例2: GetAdOverFive

 public static float GetAdOverFive(Obj_AI_Hero hero)
 {
     double basicDmg = 0;
     int attacks = (int) Math.Floor(hero.AttackSpeedMod * 5);
     for (int i = 0; i < attacks; i++)
     {
         if (hero.Crit > 0)
         {
             basicDmg += hero.GetAutoAttackDamage(player) * (1 + hero.Crit / attacks);
         }
         else
         {
             basicDmg += hero.GetAutoAttackDamage(player);
         }
     }
     return (float) basicDmg;
 }
开发者ID:uio25371555,项目名称:LeagueSharp-4,代码行数:17,代码来源:Environment.cs

示例3: GetHeroAvgDamage

        /// <summary>
        /// Gets the hero average damage to the opposing team.
        /// </summary>
        /// <param name="player">The player.</param>
        /// <param name="Enemies">The enemies.</param>
        /// <returns></returns>
        public static float GetHeroAvgDamage(Obj_AI_Hero player, List<Obj_AI_Hero> Enemies)
        {
            var totalEnemies = Enemies.Count();
            if (totalEnemies == 0)
            {
                return -1;
            }
            var AADamage = Enemies.Aggregate(0, (current, s) => (int) (current + player.GetAutoAttackDamage(s)));
            var QDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.Q).IsReady() ? player.GetSpellDamage(s, SpellSlot.Q) : 0)));
            var WDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.W).IsReady() ? player.GetSpellDamage(s, SpellSlot.W) : 0)));
            var EDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.E).IsReady() ? player.GetSpellDamage(s, SpellSlot.E) : 0)));
            var RDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.R).IsReady() ? player.GetSpellDamage(s, SpellSlot.R) : 0)));

            var totalDamage = AADamage + QDamage + WDamage + EDamage + RDamage;

            return (float) totalDamage / totalEnemies;
        }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:23,代码来源:TFHelperCalculator.cs

示例4: GetAlliesComboDmg

        public static double GetAlliesComboDmg(Obj_AI_Hero target, Obj_AI_Hero ally)
        {
            var SpellSlots = new List<SpellSlot>();
            double dmg = 0;
            #region SpellSots
            SpellSlots.Add(SpellSlot.Q);
            SpellSlots.Add(SpellSlot.W);
            SpellSlots.Add(SpellSlot.E);
            SpellSlots.Add(SpellSlot.R);
            #endregion

            foreach (var slot in SpellSlots)
            {
                var spell = ally.Spellbook.GetSpell(slot);

                dmg += ally.GetSpellDamage(target, slot);
                dmg += ally.GetAutoAttackDamage(target);
            }

            return dmg;
        }
开发者ID:Karbanthus,项目名称:LeagueSharp,代码行数:21,代码来源:Helper.cs

示例5: GetChampDmgToMe

        public static float GetChampDmgToMe(Obj_AI_Hero enemy)
        {
            double result = 0;
            double basicDmg = 0;
            int attacks = (int) Math.Floor(enemy.AttackSpeedMod * 5);
            for (int i = 0; i < attacks; i++)
            {
                if (enemy.Crit > 0)
                {
                    basicDmg += enemy.GetAutoAttackDamage(player) * (1 + enemy.Crit / attacks);
                }
                else
                {
                    basicDmg += enemy.GetAutoAttackDamage(player);
                }
            }
            result += basicDmg;
            var spells = enemy.Spellbook.Spells;
            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (t < 0.5)
                {
                    switch (enemy.SkinName)
                    {
                        case "Ahri":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot));
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Akali":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * spell.Ammo);
                            }
                            else if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot));
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Amumu":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Cassiopeia":
                            if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 2);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Fiddlesticks":
                            if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Garen":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 3);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Irelia":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
//.........这里部分代码省略.........
开发者ID:koolkaracter,项目名称:LeagueSharp,代码行数:101,代码来源:CombatHelper.cs

示例6: Game_OnGameLoad

        private static void Game_OnGameLoad(EventArgs args)
        {
            Player = ObjectManager.Player;
            if (Player.BaseSkinName != ChampionName) return;

            //Create the spells

            Q.SetSkillshot(0.25f, 40, 1200, true, SkillshotType.SkillshotLine);

            //Create the menu
            Config = new Menu(ChampionName, ChampionName, true);

            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");
            SimpleTs.AddToMenu(targetSelectorMenu);
            Config.AddSubMenu(targetSelectorMenu);

            //Orbwalker submenu
            Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));

            //Load the orbwalker and add it to the submenu.
            Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));

            Config.AddSubMenu(new Menu("Combo", "Combo"));
            Config.SubMenu("Combo").AddItem(new MenuItem("ComboQ", "Use Q?").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("ComboR","Use R?").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("ComboActive", "Combo!").SetValue(new KeyBind(32, KeyBindType.Press)));

            Config.AddSubMenu(new Menu("Harass", "Harass"));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "Use Q").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("QMana", "Min Mana Q").SetValue(new Slider(40, 1, 100)));
            Config.SubMenu("Harass").AddItem(new MenuItem("HarassActive", "Harass!").SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)));

            //Damage after combo:
            var eDamage = new MenuItem("DamageAfterCombo", "HP After Used Q+2AA").SetValue(true);
            Utility.HpBarDamageIndicator.DamageToUnit += hero => (float)(Player.GetSpellDamage(hero, SpellSlot.Q) + (Player.GetAutoAttackDamage(hero)*2));
            Utility.HpBarDamageIndicator.Enabled = eDamage.GetValue<bool>();
            eDamage.ValueChanged += delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue<bool>();
            };

            Config.AddSubMenu(new Menu("KS", "KS"));
            Config.SubMenu("KS").AddItem(new MenuItem("StealE","Steal With E").SetValue(true));
            Config.AddSubMenu(new Menu("Misc", "Misc"));
            Config.SubMenu("Misc").AddItem(new MenuItem("eStacks", "E Stacks *Broken").SetValue(new Slider(10, 2, 30)));
            Config.SubMenu("Misc").AddItem(new MenuItem("eMana", "Min Mana E").SetValue(new Slider(40, 1, 100)));
            Config.SubMenu("Misc").AddItem(new MenuItem("safer", "Use R to save allies").SetValue(true));
            Config.SubMenu("Misc").AddItem(new MenuItem("savehp", "HP to Save %").SetValue(new Slider(40, 1, 100)));
            Config.SubMenu("Misc").AddItem(new MenuItem("Harasser", "Harass Allways").SetValue(true));
               // Config.AddItem(new MenuItem("packetCast", "Packet Cast").SetValue(true));
            Config.AddSubMenu(new Menu("Drawings", "Drawings"));
            Config.SubMenu("Drawings").AddItem(new MenuItem("QRange", "Q range").SetValue(new Circle(true, Color.FromArgb(255, 255, 255, 255))));
            Config.SubMenu("Drawings") .AddItem(new MenuItem("WRange", "W range").SetValue(new Circle(false, Color.FromArgb(255, 255, 255, 255))));
            Config.SubMenu("Drawings").AddItem(new MenuItem("RRange", "R range").SetValue(new Circle(false, Color.FromArgb(255, 255, 255, 255))));
            Config.SubMenu("Drawings").AddItem(eDamage);
            Config.AddToMainMenu();

            //Add the events we are going to use:
            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnGameUpdate += Game_OnGameUpdate;
             GameObject.OnCreate += OnCreateObject;
             //   Orbwalking.BeforeAttack += OrbwalkingOnBeforeAttack;
            Game.PrintChat("<font color='#00FFFF'>>> Deniz Kalista v0.5 Loaded");
        }
开发者ID:padawanjebaczy,项目名称:NunuExplorer,代码行数:64,代码来源:Program.cs

示例7: ComboDamage

        private static float ComboDamage(Obj_AI_Hero src, Obj_AI_Hero dsc)
        {
            if (!src.IsValid || !dsc.IsValid) return 0f;
            float basicDmg = 0;
            int attacks = (int)Math.Floor(src.AttackSpeedMod*5);
            if (src.Crit>0)
            {

                basicDmg += (float)src.GetAutoAttackDamage(dsc) * attacks * (1 + src.Crit);
            }
            else
            {

                basicDmg += (float)src.GetAutoAttackDamage(dsc) * attacks;
            }
            float damage = basicDmg;
            var spells = src.Spellbook.Spells;

            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (spell.Level > 0 && t < 0.5 && Damage.GetSpellDamage(src, dsc, spell.Slot) > 0)
                {
                    switch (src.SkinName)
                    {
                                case "Ahri":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot));
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot,1));
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Akali":
                                    if (spell.Slot == SpellSlot.R)
                                    {
                                        damage += (float) (Damage.GetSpellDamage(src, dsc, spell.Slot)*spell.Ammo);
                                    }
                                    else if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot));
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot, 1));
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Amumu":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 5);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Cassiopeia":
                                    if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 2);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Fiddlesticks":
                                    if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot)*5);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Garen":
                                    if (spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 3);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Irelia":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * attacks);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Karthus":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 4);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "KogMaw":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * attacks);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "LeeSin":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot,1);
                                    }
//.........这里部分代码省略.........
开发者ID:q199230217,项目名称:LeagueSharp,代码行数:101,代码来源:Teams.cs

示例8: GetComboDMG

        public static float GetComboDMG(Obj_AI_Hero source, Obj_AI_Hero target)
        {
            double result = 0;
            double basicDmg = 0;
            int attacks = (int) Math.Floor(source.AttackSpeedMod * 5);
            for (int i = 0; i < attacks; i++)
            {
                if (source.Crit > 0)
                {
                    basicDmg += source.GetAutoAttackDamage(target, true) * (1f + source.Crit / attacks);
                }
                else
                {
                    basicDmg += source.GetAutoAttackDamage(target, true);
                }
            }
            result += basicDmg;
            var spells = source.Spellbook.Spells;
            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (t < 0.5)
                {
                    switch (source.SkinName)
                    {
                        case "Ahri":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot));
                                result += (Damage.GetSpellDamage(source, target, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Akali":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * spell.Ammo);
                            }
                            else if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot));
                                result += (Damage.GetSpellDamage(source, target, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Amumu":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Cassiopeia":
                            if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 2);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Fiddlesticks":
                            if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Garen":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 3);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Irelia":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
//.........这里部分代码省略.........
开发者ID:koolkaracter,项目名称:LeagueSharp,代码行数:101,代码来源:Helpers.cs


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