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


C# Hero.GetHashCode方法代码示例

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


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

示例1: UseDisableStageOne

 private static void UseDisableStageOne(Hero target, IEnumerable<Item> items, IEnumerable<Ability> abilities, bool stage, bool itsRealConterSpell, Hero me, uint i)
 {
     if (!me.IsValid) return;
     Item disable;
     Ability ab = null;
     Ability withOutTarget = null;
     var enumerable = items as Item[] ?? items.ToArray();
     if (stage)
     {
         disable =
             enumerable.FirstOrDefault( // wo puck_waning_rift
                 x =>
                     (x.Name == "item_sheepstick" || x.Name == "item_orchid" ||
                      x.Name == "item_abyssal_blade" ||
                      x.Name == "item_ethereal_blade" ||
                      x.Name == "item_rod_of_atos" || x.Name == "item_heavens_halberd" ||
                      x.Name == "item_medallion_of_courage" ||
                      x.Name == "item_cyclone" || x.Name == "item_solar_crest") &&
                     ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + target.Name)
                         .GetValue<AbilityToggler>()
                         .IsEnabled(x.Name));
         var enumerable1 = abilities as Ability[] ?? abilities.ToArray();
         ab =
             enumerable1.FirstOrDefault(
                 x =>
                     (x.Name == "lion_voodoo" || x.Name == "shadow_shaman_voodoo" ||
                      x.Name == "obsidian_destroyer_astral_imprisonment" || x.Name == "shadow_demon_disruption" ||
                      x.Name == "rubick_telekinesis" ||
                      x.Name == "dragon_knight_dragon_tail" ||
                      x.Name == "batrider_flaming_lasso" ||
                      x.Name == "legion_commander_duel" || x.Name == "phantom_lancer_doppelwalk" ||
                      x.Name == "winter_wyvern_winters_curse" ||
                      x.Name == "skywrath_mage_ancient_seal" /*|| x.Name == "vengefulspirit_magic_missile"*/) &&
                     ExtraSubMenu[i, 1].Item("SelectedSpells" + me.Name + target.Name)
                         .GetValue<AbilityToggler>()
                         .IsEnabled(x.Name));
         withOutTarget =
             enumerable1.FirstOrDefault(
                 x =>
                     (x.Name == "silencer_global_silence" || x.Name == "puck_phase_shift" ||
                      x.Name == "puck_waning_rift" || x.Name == "axe_berserkers_call") &&
                     ExtraSubMenu[i, 1].Item("SelectedSpells" + me.Name + target.Name)
                         .GetValue<AbilityToggler>()
                         .IsEnabled(x.Name));
         /*if (withOutTarget != null)
             Game.PrintMessage("realCastRange: " + withOutTarget.Name + " " + GetRealCastRange(withOutTarget), MessageType.ChatMessage);*/
     }
     else
     {
         disable =
             enumerable.FirstOrDefault(
                 x =>
                     (x.Name == "item_rod_of_atos" || x.Name == "item_medallion_of_courage" ||
                     x.Name == "item_solar_crest") && ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + target.Name).GetValue<AbilityToggler>().IsEnabled(x.Name));
     }
     if (Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.All ||
         Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.OnlyItems)
     {
         if (disable != null && me.Distance2D(target) <= GetRealCastRange(disable) && Menu.Item("ActiveItem" + i).GetValue<bool>())
         {
             disable.UseAbility(target);
             Utils.Sleep(250, target.GetHashCode().ToString());
             if (Menu.Item("oneenemy").GetValue<bool>()) return;
         }
     }
     
     if (Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.All ||
         Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.OnlyAblities)
     {
         
         if (ab != null && me.Distance2D(target) <= GetRealCastRange(ab) && Menu.Item("ActiveSpell" + i).GetValue<bool>())
         {
             ab.UseAbility(target);
             ab.UseAbility(me.Position);
             Utils.Sleep(250, target.GetHashCode().ToString());
             if (Menu.Item("oneenemy").GetValue<bool>()) return;
         }
         
         if (withOutTarget != null && Menu.Item("ActiveSpell" + i).GetValue<bool>())
         {
             var r = GetRealCastRange(withOutTarget);
             if (r > 0 && r >= me.Distance2D(target) || r == 0)
             {
                 withOutTarget.UseAbility();
                 Utils.Sleep(250, target.GetHashCode().ToString());
                 if (Menu.Item("oneenemy").GetValue<bool>()) return;
             }
         }
     }
     if (Menu.Item("using").GetValue<StringList>().SelectedIndex != (int) Using.All &&
         Menu.Item("using").GetValue<StringList>().SelectedIndex != (int) Using.OnlyItems) return;
     if (!itsRealConterSpell) return;
     var
         safeItemPoint =
             enumerable.FirstOrDefault(
                 x =>
                     x.Name == "item_blink");
     
     var v =
         ObjectMgr.GetEntities<Unit>()
//.........这里部分代码省略.........
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:101,代码来源:Program.cs

示例2: CounterSpellAndItems

        private static void CounterSpellAndItems(Hero target, IEnumerable<Item> items, IEnumerable<Ability> abilities, Unit me, uint i)
        {
            
            if (!me.IsValid) return;
            var enumerable = items as Item[] ?? items.ToArray();
            
            var safeItemSelf = enumerable.FirstOrDefault(
                x =>
                    (x.Name == "item_blade_mail" || x.Name == "item_ghost" /*|| x.Name == "item_black_king_bar" || 
                        x.Name == "item_manta"*/) && ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + target.Name).GetValue<AbilityToggler>().IsEnabled(x.Name));
            var safeItemTargetSelf = enumerable.FirstOrDefault(
                x =>
                    (x.Name == "item_lotus_orb" || x.Name == "item_glimmer_cape") && ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + target.Name).GetValue<AbilityToggler>().IsEnabled(x.Name));
            var safeItemTargetEnemy = enumerable.FirstOrDefault(
                x =>
                    (x.Name == "item_sheepstick" || x.Name == "item_orchid" || x.Name == "item_abyssal_blade" ||
                    x.Name == "item_heavens_halberd" || x.Name == "item_cyclone") && ExtraSubMenu[i, 0].Item("SelectedItems" + me.Name + target.Name).GetValue<AbilityToggler>().IsEnabled(x.Name));
            var safeItemPoint = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_blink");

            var safeSpell = abilities.FirstOrDefault(
                x =>
                    ( /*x.Name == "antimage_blink" || x.Name == "queenofpain_blink" ||*/
                        x.Name == "nyx_assassin_spiked_carapace" || x.Name == "silencer_last_word" ||
                        x.Name == "shadow_demon_disruption" || x.Name == "obsidian_destroyer_astral_imprisonment" ||
                        x.Name == "slark_shadow_dance" || x.Name == "slark_dark_pact" || x.Name == "puck_waning_rift" ||
                        x.Name == "axe_berserkers_call" || x.Name == "abaddon_aphotic_shield" ||
                        /*x.Name == "ember_spirit_flame_guard" ||*/ x.Name == "skywrath_mage_ancient_seal" ||
                        x.Name == "juggernaut_omni_slash" || x.Name == "doombringer_doom" ||
                        x.Name == "tusk_snowball" || x.Name == "naga_siren_mirror_image" ||
                        x.Name == "alchemist_chemical_rage" || x.Name == "bounty_hunter_wind_walk" ||
                        /*x.Name == "phantom_lancer_doppelwalk" ||*/ x.Name == "clinkz_skeleton_walk" ||
                        x.Name == "sandking_sandstorm" || x.Name == "weaver_shukuchi" ||
                        x.Name == "nyx_assassin_vendetta" || x.Name == "templar_assassin_refraction" ||
                        x.Name == "templar_assassin_meld" /*|| x.Name == "phoenix_supernova" */||
                        x.Name == "juggernaut_blade_fury" || x.Name == "life_stealer_rage" || x.Name == "lion_voodoo" ||
                        x.Name == "puck_phase_shift" || x.Name == "phantom_lancer_doppelwalk" ||
                        x.Name == "winter_wyvern_winters_curse" ||
                        x.Name == "shadow_shaman_voodoo" /*|| x.Name == "oracle_fates_edict" */||
                        /* x.Name == "winter_wyvern_cold_embrace" ||*/ x.Name == "life_stealer_rage" ||
                        x.Name == "silencer_global_silence") &&
                    ExtraSubMenu[i, 1].Item("SelectedSpells" + me.Name + target.Name)
                        .GetValue<AbilityToggler>()
                        .IsEnabled(x.Name));
            /*local v = entityList:GetEntities({classId = CDOTA_Unit_Fountain,team = me.team})[1]
				local vec = Vector((v.position.x - me.position.x) * 1100 / GetDistance2D(v,me) + me.position.x,(v.position.y - me.position.y) * 1100 / GetDistance2D(v,me) + me.position.y,v.position.z)
				if blinkfront then
					vec = Vector(me.position.x+1200*math.cos(me.rotR), me.position.y+1200*math.sin(me.rotR), me.position.z)
				end*/
            var v =
                ObjectMgr.GetEntities<Unit>()
                    .FirstOrDefault(x => x.Team == me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
            if (Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.All ||
                Menu.Item("using").GetValue<StringList>().SelectedIndex == (int) Using.OnlyItems)
            {
                if (safeItemSelf != null && Menu.Item("ActiveItem" + i).GetValue<bool>())
                {
                    safeItemSelf.UseAbility();
                    Utils.Sleep(250, target.GetHashCode().ToString());
                    if (Menu.Item("oneenemy").GetValue<bool>()) return;
                }
                //PrintError(String.Format("{0} {1}", SafeSpell.CastRange,SafeSpell.Name));
                if (safeItemPoint != null && Menu.Item("usedagger").GetValue<bool>() && me.Distance2D(target) <= 1000)
                {
                    if (v != null && v.IsValid)
                    {
                        safeItemPoint.UseAbility(v.Position);
                        Utils.Sleep(250, target.GetHashCode().ToString());
                        if (Menu.Item("oneenemy").GetValue<bool>()) return;
                    }
                }
                if (safeItemTargetEnemy != null && safeItemTargetEnemy.CanBeCasted(target) && Menu.Item("ActiveItem" + i).GetValue<bool>())
                {
                    if (me.Distance2D(target) <= GetRealCastRange(safeItemTargetEnemy))
                    {
                        safeItemTargetEnemy.UseAbility(target);
                        Utils.Sleep(250, target.GetHashCode().ToString());
                        if (Menu.Item("oneenemy").GetValue<bool>()) return;
                    }
                }
                if (safeItemTargetSelf != null && Menu.Item("ActiveItem" + i).GetValue<bool>())
                {
                    safeItemTargetSelf.UseAbility(me);
                    Utils.Sleep(250, target.GetHashCode().ToString());
                    if (Menu.Item("oneenemy").GetValue<bool>()) return;

                }
            }
            if (!Menu.Item("ActiveSpell" + i).GetValue<bool>() || safeSpell == null || !safeSpell.CanBeCasted() ||
                (Menu.Item("using").GetValue<StringList>().SelectedIndex != (int) Using.All &&
                 Menu.Item("using").GetValue<StringList>().SelectedIndex != (int) Using.OnlyAblities)) return;
            //Game.PrintMessage(safeSpell.Name+" "+safeSpell.AbilityBehavior,MessageType.ChatMessage);
            if (GetRealCastRange(safeSpell) >= me.Distance2D(target) || safeSpell.AbilityBehavior == AbilityBehavior.NoTarget || safeSpell.AbilityBehavior == AbilityBehavior.Point || safeSpell.ClassID==ClassID.CDOTA_Ability_PhantomLancer_Doppelwalk)
            {
                safeSpell.UseAbility();
                safeSpell.UseAbility(target);
                safeSpell.UseAbility(me.Position);
            }
            Utils.Sleep(250, target.GetHashCode().ToString());
//.........这里部分代码省略.........
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:101,代码来源:Program.cs

示例3: UseDisableStageOne

        private static void UseDisableStageOne(Hero target, IEnumerable<Item> items, IEnumerable<Ability> abilities,
            bool stage)
        {
            if (_me != null && !(_me.Health/_me.MaximumHealth > 0.1)) return;
            Item disable;
            Ability ab = null;
            Ability withOutTarget = null;
            var enumerable = items as Item[] ?? items.ToArray();
            if (stage)
            {
                disable =
                    enumerable.FirstOrDefault( // wo puck_waning_rift
                        x =>
                            x.Name == "item_sheepstick" || x.Name == "item_orchid" ||
                            x.Name == "item_abyssal_blade" ||
                            x.Name == "item_ethereal_blade" ||
                            x.Name == "item_rod_of_atos" || x.Name == "item_heavens_halberd" ||
                            x.Name == "item_medallion_of_courage" ||
                            x.Name == "item_cyclone" || x.Name == "item_solar_crest");
                var enumerable1 = abilities as Ability[] ?? abilities.ToArray();
                ab =
                    enumerable1.FirstOrDefault(
                        x =>
                            x.Name == "lion_voodoo" || x.Name == "shadow_shaman_voodoo" ||
                            x.Name == "obsidian_destroyer_astral_imprisonment" || x.Name == "shadow_demon_disruption" ||
                            x.Name == "rubick_telekinesis" ||
                            x.Name == "dragon_knight_dragon_tail" ||
                            x.Name == "batrider_flaming_lasso" ||
                            x.Name == "legion_commander_duel" ||
                            x.Name == "skywrath_mage_ancient_seal");
                withOutTarget =
                    enumerable1.FirstOrDefault(
                        x =>
                            x.Name == "silencer_global_silence");
            }
            else
            {
                disable =
                    enumerable.FirstOrDefault(
                        x =>
                            x.Name == "item_rod_of_atos" || x.Name == "item_medallion_of_courage" ||
                            x.Name == "item_solar_crest");
            }

            if (disable != null && _me.Distance2D(target) <= disable.CastRange)
            {
                disable.UseAbility(target);
                Utils.Sleep(250, target.GetHashCode().ToString());
                return;
            }
            if (ab != null && _me.Distance2D(target) <= ab.CastRange)
            {
                ab.UseAbility(target);
                Utils.Sleep(250, target.GetHashCode().ToString());
                return;
            }
            if (withOutTarget != null)
            {
                withOutTarget.UseAbility();
                Utils.Sleep(250, target.GetHashCode().ToString());
                return;
            }
            var safeItemPoint =
                enumerable.FirstOrDefault(
                    x =>
                        x.Name == "item_blink");
            var v =
                ObjectMgr.GetEntities<Unit>()
                    .FirstOrDefault(x => x.Team == _me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
            if (safeItemPoint != null && _autoBlink)
            {
                if (v != null)
                {
                    safeItemPoint.UseAbility(v.Position);
                }
                Utils.Sleep(250, target.GetHashCode().ToString());
            }
        }
开发者ID:kobra322,项目名称:EnsageSharp-1,代码行数:78,代码来源:Program.cs

示例4: UseDisableStageOne

        private static void UseDisableStageOne(Hero target, IEnumerable<Item> items, IEnumerable<Ability> abilities, bool stage)
        {
            if (!(_me.Health / _me.MaximumHealth > 0.1)) return;
            Item disable;
            Ability ab = null;
            if (stage)
            {
                disable =
                    items.FirstOrDefault( // wo puck_waning_rift
                        x =>
                            x.Name == "item_sheepstick" || x.Name == "item_orchid" ||
                            x.Name == "item_abyssal_blade" ||
                            x.Name == "item_ethereal_blade" ||
                            x.Name == "item_rod_of_atos" || x.Name == "item_heavens_halberd" ||
                            x.Name == "item_medallion_of_courage" ||
                            x.Name == "item_cyclone" || x.Name == "item_solar_crest");
                ab =
                    abilities.FirstOrDefault(
                        x =>
                            x.Name == "lion_voodoo" || x.Name == "shadow_shaman_voodoo" ||
                            x.Name == "obsidian_destroyer_astral_imprisonment" || x.Name == "shadow_demon_disruption" ||
                            x.Name == "rubick_telekinesis" ||
                            x.Name == "dragon_knight_dragon_tail" ||
                            x.Name == "batrider_flaming_lasso" ||
                            x.Name == "legion_commander_duel" ||
                            x.Name == "skywrath_mage_ancient_seal");
            }
            else
            {
                disable = items.FirstOrDefault(x => x.Name == "item_rod_of_atos" || x.Name == "item_medallion_of_courage" || x.Name == "item_solar_crest");
            }

            if (disable != null && _me.Distance2D(target) <= disable.CastRange)
            {
                disable.UseAbility(target);
                Utils.Sleep(250, target.GetHashCode().ToString());
            }
            if (ab != null && _me.Distance2D(target) <= ab.CastRange)
            {
                ab.UseAbility(target);
                Utils.Sleep(250, target.GetHashCode().ToString());
            }
        }
开发者ID:superfreeman1989,项目名称:EnsageSharp,代码行数:43,代码来源:Program.cs

示例5: UsaSafeItems

        private static void UsaSafeItems(Hero target, IEnumerable<Item> items, IEnumerable<Ability> abilities)
        {
            var enumerable = items as Item[] ?? items.ToArray();
            var safeItemSelf = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_blade_mail" /*|| x.Name == "item_black_king_bar" || x.Name == "item_ghost" ||
                        x.Name == "item_manta"*/);
            var safeItemTargetSelf = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_lotus_orb" || x.Name == "item_cyclone" || x.Name == "item_glimmer_cape");
            var safeItemTargetEnemy = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_sheepstick" || x.Name == "item_orchid" || x.Name == "item_abyssal_blade" ||
                    x.Name == "item_heavens_halberd");
            var safeItemPoint = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_blink");

            var safeSpell = abilities.FirstOrDefault(
                x =>
                    /*x.Name == "antimage_blink" || x.Name == "queenofpain_blink" ||*/
                    x.Name == "nyx_assassin_spiked_carapace" || x.Name == "silencer_last_word" ||
                    x.Name == "shadow_demon_disruption" || x.Name == "obsidian_destroyer_astral_imprisonment" ||
                    x.Name == "slark_shadow_dance" || x.Name == "slark_dark_pact" || x.Name == "puck_waning_rift" ||
                    x.Name == "axe_berserkers_call" || x.Name == "abaddon_aphotic_shield" ||
                    /*x.Name == "ember_spirit_flame_guard" ||*/ x.Name == "skywrath_mage_ancient_seal" ||
                    x.Name == "juggernaut_omni_slash" || x.Name == "doombringer_doom" ||
                    x.Name == "tusk_snowball" || x.Name == "naga_siren_mirror_image" ||
                    x.Name == "alchemist_chemical_rage" || x.Name == "bounty_hunter_wind_walk" ||
                    /*x.Name == "phantom_lancer_doppelwalk" ||*/ x.Name == "clinkz_skeleton_walk" ||
                    x.Name == "sandking_sandstorm" || x.Name == "weaver_shukuchi" ||
                    x.Name == "nyx_assassin_vendetta" || x.Name == "templar_assassin_refraction" ||
                    x.Name == "templar_assassin_meld" /*|| x.Name == "phoenix_supernova" */||
                    x.Name == "juggernaut_blade_fury" || x.Name == "life_stealer_rage" || x.Name == "lion_voodoo" ||
                    x.Name == "shadow_shaman_voodoo" /*|| x.Name == "oracle_fates_edict" */||
                    /* x.Name == "winter_wyvern_cold_embrace" ||*/ x.Name == "life_stealer_rage" || x.Name == "silencer_global_silence");
            /*local v = entityList:GetEntities({classId = CDOTA_Unit_Fountain,team = me.team})[1]
                local vec = Vector((v.position.x - me.position.x) * 1100 / GetDistance2D(v,me) + me.position.x,(v.position.y - me.position.y) * 1100 / GetDistance2D(v,me) + me.position.y,v.position.z)
                if blinkfront then
                    vec = Vector(me.position.x+1200*math.cos(me.rotR), me.position.y+1200*math.sin(me.rotR), me.position.z)
                end*/
            var v =
                ObjectMgr.GetEntities<Unit>()
                    .FirstOrDefault(x => x.Team == _me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
            if (safeItemSelf != null)
            {
                safeItemSelf.UseAbility();
                Utils.Sleep(250, target.GetHashCode().ToString());
                return;
            }
            //PrintError(String.Format("{0} {1}", SafeSpell.CastRange,SafeSpell.Name));
            if (safeItemPoint != null && _autoBlink)
            {
                if (v != null)
                {
                    safeItemPoint.UseAbility(v.Position);
                    Utils.Sleep(250, target.GetHashCode().ToString());
                    return;
                }
            }
            if (safeItemTargetEnemy != null && safeItemTargetEnemy.CanBeCasted(target))
            {
                if (_me.Distance2D(target) <= safeItemTargetEnemy.CastRange)
                {
                    safeItemTargetEnemy.UseAbility(target);
                    Utils.Sleep(250, target.GetHashCode().ToString());
                    return;
                }
            }
            if (safeItemTargetSelf != null)
            {
                safeItemTargetSelf.UseAbility(_me);
                Utils.Sleep(250, target.GetHashCode().ToString());
                return;

            }

            if (safeSpell != null && safeSpell.CanBeCasted())
            {
                if (safeSpell.CastRange > 0)
                {
                    if (_me.Distance2D(target) <= safeSpell.CastRange)
                    {
                        safeSpell.UseAbility(target);
                    }
                }
                else
                {
                    safeSpell.UseAbility();
                }
                Utils.Sleep(250, target.GetHashCode().ToString());
            }
        }
开发者ID:kobra322,项目名称:EnsageSharp-1,代码行数:93,代码来源:Program.cs


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