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


C# Hero.GetDagon方法代码示例

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


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

示例1: CalculateManaRequired

        public static int CalculateManaRequired(Hero me)
        {
            try
            {
                if (Utils.SleepCheck("manaCalcErrorTimeout"))
                {
                    var hook = me.Spellbook.Spell1;
                    var dismember = me.Spellbook.SpellR;
                    var urn = me.FindItem("item_urn_of_shadows");
                    var eblade = me.FindItem("item_ethereal_blade");
                    var dagon = me.GetDagon();
                    var ManaRequired = 0;

                    if (hook != null)
                        ManaRequired += (int)hook.ManaCost;
                    if (dismember != null)
                        ManaRequired += (int)dismember.ManaCost;
                    if (eblade != null)
                        ManaRequired += (int)eblade.ManaCost;
                    if (dagon != null)
                        ManaRequired += (int)dagon.ManaCost;
                    return (int)ManaRequired;
                }
                return 0;
            }
            catch (Exception ex)
            {
                // Print.Error("MANACALC: " + ex.Message);
                Utils.Sleep(500, "manaCalcErrorTimeout");
                return 0;
            }
        }
开发者ID:NadeHouse,项目名称:Pudge-Plus,代码行数:32,代码来源:HookHandler.cs

示例2: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            if (sleeper.Sleeping)
            {
                return;
            }

            dagon = hero.GetDagon();

            if (dagon == null || Game.IsPaused || !Menu.Item("key").GetValue<KeyBind>().Active || hero.IsChanneling()
                || (hero.IsInvisible() && !hero.IsVisibleToEnemies))
            {
                sleeper.Sleep(200);
                return;
            }

            if (hero.ClassID == ClassID.CDOTA_Unit_Hero_ArcWarden)
            {
                heroClone =
                    ObjectManager.GetEntities<Hero>()
                        .FirstOrDefault(
                            x =>
                            x.IsAlive && x.Team == hero.Team
                            && x.HasModifier("modifier_arc_warden_tempest_double"));

                if (heroClone != null)
                {
                    dagonClone = heroClone.GetDagon();
                }
            }

            var target = ObjectManager.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x));

            if (target != null)
            {
                if (hero.CanUseItems() && dagon.CanBeCasted())
                {
                    dagon.UseAbility(target);
                }
                else if (heroClone != null && dagonClone.CanBeCasted() && heroClone.CanUseItems())
                {
                    dagonClone.UseAbility(target);
                }
            }
            else if (heroClone != null)
            {
                if (dagonClone.CanBeCasted() && heroClone.CanUseItems() && dagon.CanBeCasted() && hero.CanUseItems())
                {
                    target = ObjectManager.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x, true));
                    if (target != null)
                    {
                        dagon.UseAbility(target);
                        dagonClone.UseAbility(target);
                    }
                }
            }

            sleeper.Sleep(200);
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:59,代码来源:Program.cs

示例3: Skills

                public static void Skills(Hero enemy)
                {
                    if (enemy != null)
                    {
                        try
                        {
                            int counter = 0;
                            foreach (var spell in enemy.Spellbook.Spells)
                            {
                                int Height = 20;
                                if (Variables.Settings.Enemy_Skills_Value.val == 1)
                                    Height = 0;
                                if (spell == null || spell.Name == "attribute_bonus") continue;
                                int Cooldown = (int)spell.Cooldown;
                                //Print.Info(enemy.Name + " " + enemy.Spellbook.Spells.ToList().Count);
                                Vector2 heroBase = Drawing.WorldToScreen(enemy.Position) + new Vector2(- ((20 * (enemy.Spellbook.Spells.ToList().Count -1)/2)) , 40); //Base drawing point
                                if (Variables.Settings.Enemy_Skills_Value.val == 0)
                                    Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, 0), new Vector2(20, 20), Drawing.GetTexture(string.Format("materials/ensage_ui/spellicons/{0}.vmat", spell.Name ))); //Skill icons
                                Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, Height), new Vector2(20, Cooldown == 0 ? 6 : 22), new ColorBGRA(0, 0, 0, 100), true); //Skill box outlines
                                if (spell.ManaCost > enemy.Mana) //Out of mana - Draw background Blue
                                    Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, Height), new Vector2(20, Cooldown == 0 ? 6 : 22), new ColorBGRA(0, 0, 150, 150));
                                if (Cooldown > 0) //Draw cool down
                                {
                                    var text = Cooldown.ToString();
                                    var textSize = Drawing.MeasureText(text, "Arial", new Vector2(10, 200), FontFlags.Outline | FontFlags.AntiAlias); //Measure text
                                    var textPos = (heroBase + new Vector2(counter * 20 - 5, Height) - 1 + new Vector2(10 - textSize.X / 2, -textSize.Y / 2 + 12));
                                    Drawing.DrawText(text, textPos, Color.White, FontFlags.AntiAlias | FontFlags.Outline);
                                }
                                if (spell.Level > 0)
                                    for (int lvl = 1; lvl <= spell.Level; lvl++)

                                        Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5 + 3 * lvl, Height + 2), new Vector2(2, 2), new ColorBGRA(255, 255, 0, 255), true); //Draw skill level
                                counter++; //Skill index
                            }
                            if (Variables.Settings.Enemy_Skills_Value.val == 0)
                            {
                                Item[] specialItems = { enemy.FindItem("item_blink"), enemy.FindItem("item_force_staff"), enemy.GetDagon() };
                                foreach (var item in specialItems)
                                {
                                    if (item != null)
                                    {
                                        int Cooldown = (int)item.Cooldown;
                                        Vector2 heroBase = Drawing.WorldToScreen(enemy.Position) + new Vector2(-((20 * (enemy.Spellbook.Spells.ToList().Count - 1) / 2)), 40); //Base drawing point
                                        Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, 0), new Vector2(28, 20), Drawing.GetTexture(string.Format("materials/ensage_ui/items/{0}.vmat", item.Name.Remove(0, 5)))); //Skill box outlines
                                        Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, 20), new Vector2(20, Cooldown == 0 ? 6 : 22), new ColorBGRA(0, 0, 0, 100), true); //Skill box outlines
                                        if (item.ManaCost > enemy.Mana) //Out of mana - Draw background Blue
                                            Drawing.DrawRect(heroBase + new Vector2(counter * 20 - 5, 20), new Vector2(20, Cooldown == 0 ? 6 : 22), new ColorBGRA(0, 0, 150, 150));
                                        if (Cooldown > 0) //Draw cool down
                                        {
                                            var text = Cooldown.ToString();
                                            var textSize = Drawing.MeasureText(text, "Arial", new Vector2(10, 200), FontFlags.Outline | FontFlags.AntiAlias); //Measure text
                                            var textPos = (heroBase + new Vector2(counter * 20 - 5, 20) - 1 + new Vector2(10 - textSize.X / 2, -textSize.Y / 2 + 12));
                                            Drawing.DrawText(text, textPos, Color.White, FontFlags.AntiAlias | FontFlags.Outline);
                                        }
                                        counter++; //Skill index
                                    }
                                }
                            }
                        }
                        catch
                        { }
                    }
                }
开发者ID:Rulfy,项目名称:Pudge-Plus,代码行数:63,代码来源:ESP.cs

示例4: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;

            if (me == null || !Game.IsInGame || Game.IsWatchingGame)
                return;

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
                return;

            // Ability init
            Laser = me.Spellbook.Spell1;
            Rocket = me.Spellbook.Spell2;
            Refresh = me.Spellbook.Spell4;

            // Item init
            Blink = me.FindItem("item_blink");
            Dagon = me.GetDagon();
            Hex = me.FindItem("item_sheepstick");
            Soulring = me.FindItem("item_soul_ring");
            Ethereal = me.FindItem("item_ethereal_blade");
            Veil = me.FindItem("item_veil_of_discord");
            Orchid = me.FindItem("item_orchid");
            Shiva = me.FindItem("item_shiva");

            // Manacost calculations
            var manaForCombo = Laser.ManaCost + Rocket.ManaCost;
            if (Dagon != null && Dagon.CanBeCasted())
                manaForCombo += 180;
            if (Hex != null && Hex.CanBeCasted())
                manaForCombo += 100;
            if (Ethereal != null && Ethereal.CanBeCasted())
                manaForCombo += 150;
            if (Veil != null && Veil.CanBeCasted())
                manaForCombo += 50;

            // Main combo
            if (active && toggle)
            {
                target = me.ClosestToMouseTarget(1000);
                if (target != null && target.IsAlive && !target.IsIllusion && !target.IsMagicImmune() && Utils.SleepCheck("refresh") && !Refresh.IsChanneling)
                {
                    if (Soulring != null && me.Mana < manaForCombo && Soulring.CanBeCasted() && me.Health > 400 && Utils.SleepCheck("soulring"))
                    {
                        Soulring.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "soulring");
                    }

                    // Blink
                    else if (Blink != null && Blink.CanBeCasted() && Utils.SleepCheck("blink"))
                    {
                        Utils.Sleep(300 + Game.Ping, "blink");
                        Utils.ChainStun(me, me.GetTurnTime(target) * 1000 + Game.Ping, null, false);
                        Blink.UseAbility(target.Position);
                    }

                    // Items
                    else if (Veil != null && Veil.CanBeCasted() && Utils.SleepCheck("veil"))
                    {
                        Veil.UseAbility(target.Position);
                        Utils.Sleep(150 + Game.Ping, "veil");
                        Utils.Sleep(300 + Game.Ping, "ve");
                        Utils.ChainStun(me, 170 + Game.Ping, null, false);
                    }

                    else if (Hex != null && Hex.CanBeCasted() && Utils.SleepCheck("hex"))
                    {
                        Hex.UseAbility(target);
                        Utils.Sleep(150 + Game.Ping, "hex");
                        Utils.Sleep(300 + Game.Ping, "h");
                        Utils.ChainStun(me, 170 + Game.Ping, null, false);
                    }

                    else if (Ethereal != null && Ethereal.CanBeCasted() && Utils.SleepCheck("ethereal"))
                    {
                        Ethereal.UseAbility(target);
                        Utils.Sleep(270 + Game.Ping, "ethereal");
                        Utils.ChainStun(me, 200 + Game.Ping, null, false);
                    }

                    else if (Dagon != null && Dagon.CanBeCasted() && Utils.SleepCheck("ethereal") && Utils.SleepCheck("h") && Utils.SleepCheck("dagon") && Utils.SleepCheck("veil"))
                    {
                        Dagon.UseAbility(target);
                        Utils.Sleep(270 + Game.Ping, "dagon");
                        Utils.ChainStun(me, 200 + Game.Ping, null, false);
                    }

                    // Skills
                    else if (Rocket != null && Rocket.CanBeCasted() && Utils.SleepCheck("rocket") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("veil"))
                    {
                        Rocket.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "rocket");
                        Utils.ChainStun(me, 150 + Game.Ping, null, false);
                    }

                    else if (Laser != null && Laser.CanBeCasted() && Utils.SleepCheck("laser") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("rocket"))
                    {
                        Laser.UseAbility(target);
                        Utils.Sleep(150 + Game.Ping, "laser");
                        Utils.ChainStun(me, 150 + Game.Ping, null, false);
//.........这里部分代码省略.........
开发者ID:Malicy,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例5: CalculateMaximumDamageOutput

        public static int CalculateMaximumDamageOutput(Hero me, Hero enemy)
        {
            try
            {
                var hook = me.Spellbook.Spell1;
                var rot = me.Spellbook.SpellW;
                var dismember = me.Spellbook.SpellR;
                var urn = me.FindItem("item_urn_of_shadows");
                var dagon = me.GetDagon();
                var eblade = me.FindItem("item_ethereal_blade");
                var Damage = 0;
                var theoreticalMana = me.Mana;
                var resis = 1 - enemy.MagicDamageResist;

                if (hook != null)
                    if (hook.Level > 0 && theoreticalMana - hook.ManaCost >= 0 && hook.AbilityState == AbilityState.Ready)
                    {
                        if (me.AghanimState())
                            Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter").GetValue(hook.Level - 1);
                        else
                        Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(hook.Level - 1);
                        theoreticalMana -= hook.ManaCost;
                    }
                if (eblade != null)
                {
                    int dmg = (int)(((me.TotalStrength  + 75) * 2) * resis);
                    if (Variables.AetherLens)
                        dmg = (int)(dmg * 1.08);
                    theoreticalMana -= eblade.ManaCost;
                    Damage += dmg;
                   // Print.Info(dmg.ToString());
                }
                if (dismember != null && rot != null)
                {

                    if (dismember.Level > 0 && theoreticalMana - dismember.ManaCost >= 0 && dismember.AbilityState == AbilityState.Ready)
                    {
                        if (rot.Level > 0)
                        {
                            var rotDPS = (int)rot.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(rot.Level - 1);
                            var totalDmgAfterResis = (rotDPS * 3) * resis;
                            if (Variables.AetherLens)
                                totalDmgAfterResis = (float)(totalDmgAfterResis * 1.08);
                            Damage += (int)totalDmgAfterResis;

                        }
                        var ultiDamage = dismember.AbilityData.FirstOrDefault(x => x.Name == "dismember_damage").GetValue(dismember.Level - 1);
                        if (me.AghanimState())
                        {
                            //ultiDamage += (float)(me.TotalStrength * (0.2 + (dismember.Level * 0.10)));

                            var scepterDamage = ultiDamage + (me.TotalStrength * (0.2 + (dismember.Level * 0.10)));//ultiDamage + (me.TotalStrength * dismember.AbilityData.FirstOrDefault(x => x.Name == "strength_damage_scepter").GetValue(dismember.Level - 1));
                            var totalDamageAfterResis = scepterDamage * resis;
                            if (Variables.AetherLens)
                                totalDamageAfterResis = (float)(totalDamageAfterResis * 1.08);
                            ultiDamage = (float)totalDamageAfterResis * 3;
                        }
                        else
                        {
                            var damagePerTickAfterResis = ultiDamage * resis;
                            if (Variables.AetherLens)
                                damagePerTickAfterResis = (float)(damagePerTickAfterResis * 1.08);
                            ultiDamage = damagePerTickAfterResis * 3;
                        }
                        Damage += (int)ultiDamage;
                        theoreticalMana -= dismember.ManaCost;
                    }
                    if (urn != null)
                        if (urn.CurrentCharges > 0)
                            Damage += 100;
                    if (dagon != null)
                        if (dagon != null && theoreticalMana - dagon.ManaCost >= 0 && dagon.AbilityState == AbilityState.Ready)
                        {
                            var dagonDamageAfterResis = (int)dagon.AbilityData.FirstOrDefault(x => x.Name == "damage").GetValue(dagon.Level - 1) * resis;
                            if (Variables.AetherLens)
                                dagonDamageAfterResis = (float)(dagonDamageAfterResis * 1.08);
                            Damage += (int)dagonDamageAfterResis;

                            theoreticalMana -= dagon.ManaCost;
                        }
                }
                if (eblade != null)
                    return (int)(Damage * 1.4);
                else
                    return Damage;

            }
            catch (Exception ex)
            {
                Print.Error("DAMAGE: " + ex.Message);
                return 0;
            }
        }
开发者ID:NadeHouse,项目名称:Pudge-Plus,代码行数:93,代码来源:HookHandler.cs

示例6: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args) {
            if (!Utils.SleepCheck("dagonStealDelay"))
                return;

            if (!inGame) {
                hero = ObjectMgr.LocalHero;

                if (!Game.IsInGame || hero == null) {
                    Utils.Sleep(1000, "dagonStealDelay");
                    return;
                }

                inGame = true;
            }

            if (!Game.IsInGame) {
                inGame = false;
                return;
            }

            dagon = hero.GetDagon();

            if (dagon == null || Game.IsPaused || !Menu.Item("key").GetValue<KeyBind>().Active) {
                Utils.Sleep(200, "dagonStealDelay");
                return;
            }

            if (hero.IsChanneling() || hero.IsInvisible()) {
                Utils.Sleep(200, "dagonStealDelay");
                return;
            }

            if (hero.ClassID == ClassID.CDOTA_Unit_Hero_ArcWarden) {
                heroClone =
                    ObjectMgr.GetEntities<Hero>()
                        .FirstOrDefault(
                            x =>
                                x.IsAlive && x.Team == hero.Team &&
                                x.Modifiers.Any(mod => mod.Name == "modifier_arc_warden_tempest_double"));

                if (heroClone != null) {
                    dagonClone = heroClone.GetDagon();
                }
            }

            var target = ObjectMgr.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x));

            if (target != null) {
                if (hero.CanUseItems() && dagon.CanBeCasted())
                    dagon.UseAbility(target);
                else if (heroClone != null && dagonClone.CanBeCasted() && heroClone.CanUseItems())
                    dagonClone.UseAbility(target);
            } else if (heroClone != null) {
                if (dagonClone.CanBeCasted() && heroClone.CanUseItems() && dagon.CanBeCasted() && hero.CanUseItems()) {
                    target = ObjectMgr.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x, true));
                    if (target != null) {
                        dagon.UseAbility(target);
                        dagonClone.UseAbility(target);
                    }
                }
            }

            Utils.Sleep(200, "dagonStealDelay");
        }
开发者ID:RetiredQQ,项目名称:Ensage,代码行数:64,代码来源:Program.cs

示例7: LetsUseItems

        private static void LetsUseItems(Hero me, Hero target)
        {

            if (Push != null && Push.CanBeCasted()) return;
            var itemOnTarget =
                me.Inventory.Items.FirstOrDefault(
                    x =>
                        (x.Name == "item_abyssal_blade" || x.Name == "item_orchid" ||
                         x.Name == "item_heavens_halberd" || x.Name == "item_sheepstick" ||
                         (x.Name == "item_urn_of_shadows" && x.CurrentCharges>0)|| x.Name == "item_medallion_of_courage" ||
                         x.Name == "item_solar_crest") && x.CastRange >= me.Distance2D(target) && x.CanBeCasted() &&
                        Utils.SleepCheck(x.GetHashCode().ToString()));
            //Game.PrintMessage(me.FindItem("item_solar_crest").CastRange.ToString(), MessageType.LogMessage);
            if (itemOnTarget!=null)
            {
                itemOnTarget.UseAbility(target);
                Utils.Sleep(300,itemOnTarget.GetHashCode().ToString());
            }
            var dagon = me.GetDagon();
            if (dagon != null && dagon.CanBeCasted(target) && me.Distance2D(target) <= dagon.CastRange)
            {
                dagon.UseAbility(target);
            }
        }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:24,代码来源:Program.cs


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