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


C# Obj_AI_Base.GetType方法代码示例

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


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

示例1: ProcessSpell_OrianaRedactCommand

        private static void ProcessSpell_OrianaRedactCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (hero.GetType() != typeof(AIHeroClient) || !((AIHeroClient) hero).IsValid())
                return;

            var champ = (AIHeroClient)hero;

            if (champ.ChampionName == "Orianna" && champ.IsEnemy)
            {
                if (args.SData.Name == "OrianaRedactCommand")
                {
                    foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                    {
                        var info = entry.Value;

                        if (entry.Value.Name == "TheDoomBall")
                        {
                            info.usePosition = false;
                            info.obj = args.Target;
                        }
                    }
                }
            }
        }
开发者ID:HeheheM,项目名称:Elobuddy-3,代码行数:24,代码来源:Orianna.cs

示例2: Turret_OnTarget

 private static void Turret_OnTarget(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender.GetType() == typeof(Obj_AI_Turret))
     {
         TurretHasAggro[sender.NetworkId] = !(args.Target == null || args.Target is Obj_AI_Minion);
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:7,代码来源:Program.cs

示例3: Obj_AI_Hero_OnProcessSpellCast

        private void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!IsActive())
                return;
            if (sender.GetType() == typeof (Obj_AI_Hero))
            {
                var hero = (Obj_AI_Hero) sender;
                if (hero.IsEnemy)
                {
                    Obj_AI_Hero enemy = hero;
                    foreach (var abilities in Enemies)
                    {
                        if (abilities.Key.NetworkId != enemy.NetworkId)
                            continue;
                        int index = 0;
                        foreach (Ability ability in abilities.Value)
                        {
                            if (args.SData.Name.ToLower() == "vayneinquisition")
                            {
                                if (ability.ExtraTicks > 0)
                                {
                                    ability.ExtraTicks = (int) Game.Time + 6 + 2*args.Level;
                                    return;
                                }
                            }
                            if (args.SData.Name.ToLower() == ability.SpellName.ToLower())
                            {
                                switch (ability.SpellName.ToLower())
                                {
                                    case "vaynetumble":
                                        if (Game.Time >= ability.ExtraTicks)
                                            return;
                                        ability.StartPos = args.Start;
                                        ability.EndPos = CalculateEndPos(ability, args);
                                        break;

                                    case "deceive":
                                        ability.OutOfBush = false;
                                        ability.StartPos = args.Start;
                                        ability.EndPos = CalculateEndPos(ability, args);
                                        break;

                                    case "leblancslidem":
                                        abilities.Value[index - 2].Casted = false;
                                        ability.StartPos = abilities.Value[index - 2].StartPos;
                                        ability.EndPos = CalculateEndPos(ability, args);
                                        break;

                                    case "leblancslidereturn":
                                    case "leblancslidereturnm":
                                        if (ability.SpellName == "leblancslidereturn")
                                        {
                                            abilities.Value[index - 1].Casted = false;
                                            abilities.Value[index + 1].Casted = false;
                                            abilities.Value[index + 2].Casted = false;
                                        }
                                        else
                                        {
                                            abilities.Value[index - 3].Casted = false;
                                            abilities.Value[index - 2].Casted = false;
                                            abilities.Value[index - 1].Casted = false;
                                        }
                                        ability.StartPos = args.Start;
                                        ability.EndPos = abilities.Value[index - 1].StartPos;
                                        break;

                                    case "fioraDance":
                                    case "alphaStrike":
                                        //TODO: Get Target
                                        //ability.Target = args.Target;
                                        ability.TargetDead = false;
                                        ability.StartPos = args.Start;
                                        //ability.EndPos = args.Target.Position;
                                        break;

                                    default:
                                        ability.StartPos = args.Start;
                                        ability.EndPos = CalculateEndPos(ability, args);
                                        break;
                                }
                                ability.Casted = true;
                                ability.TimeCasted = (int) Game.Time;
                                return;
                            }
                            index++;
                        }
                    }
                }
            }
        }
开发者ID:kampfi,项目名称:SAwarenessBeta,代码行数:90,代码来源:Destination.cs

示例4: SheenDamage

 // Thanks princer007 for the basic idea
 private static double SheenDamage(Obj_AI_Base target)
 {
     var result = 0d;
     foreach (var item in Player.InventoryItems)
         switch ((int)item.Id)
         {
             case 3025: //Iceborn Gauntlet
                 if (Item.CanUseItem((int)ItemId.Iceborn_Gauntlet))
                     result += Player.CalculateDamageOnUnit(target, DamageType.Physical, Player.BaseAttackDamage * 1.25f );
                 break;
             case 3057: //Sheen
                 if (Item.CanUseItem((int)ItemId.Sheen))
                     result += Player.CalculateDamageOnUnit(target, DamageType.Physical, Player.BaseAttackDamage);
                         //Player.GetItemDamage(target, ItemId.Sheen);
                 break;
             case 3078: //Triforce
                 if (Item.CanUseItem((int)ItemId.Trinity_Force))
                     result += Player.CalculateDamageOnUnit(target, DamageType.Physical, Player.BaseAttackDamage * 2);
                         //Player.GetItemDamage(target, ItemId.Trinity_Force);
                 break;
             case 3134: //Serrated Dirk
                 if (Player.HasBuff("Serrated"))
                     result += Player.CalculateDamageOnUnit(target, DamageType.Physical, 15);
                 break;
         }
     if (target.GetType().ToString() == "EloBuddy.AIHeroClient")
         if (Player.HasBuff("MasteryOnHitDamageStacker")) //Rip 5.24 (0.9f + 0.42f * Player.Level), Now 6.1 (1.04f + 6.16f * Player.Level)
             result += Player.CalculateDamageOnUnit(target, DamageType.Physical, FervorofBattle[Player.Level - 1] * Player.GetBuffCount("MasteryOnHitDamageStacker"));
     return result;
 }
开发者ID:commonsharp,项目名称:EloBuddy-Addons,代码行数:31,代码来源:Program.cs

示例5: OnStopCast

        private static void OnStopCast(Obj_AI_Base sender, SpellbookStopCastEventArgs args)
        {
            if (!StopCast)
            {
                return;
            }

            if (!Directory.Exists(ResultPath))
            {
                Directory.CreateDirectory(ResultPath);
            }

            using (var writer = File.CreateText(Path.Combine(ResultPath, MethodBase.GetCurrentMethod().Name + ".txt")))
            {
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("OnStopCast, analysing properties...");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                writer.Write(" - Sender type: ");
                writer.Flush();
                writer.WriteLine(sender.GetType().Name);
                writer.Write(" - Sender name: ");
                writer.Flush();
                writer.WriteLine(sender.BaseSkinName);
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing all public properties of sender");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in sender.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(sender, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing all public properties of SpellbookStopCastEventArgs");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in args.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(args, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing OnStopCast complete!");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine();
            }
        }
开发者ID:tswierkot,项目名称:EloBuddy-Addons,代码行数:52,代码来源:Program.cs

示例6: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!Directory.Exists(ResultPath))
            {
                Directory.CreateDirectory(ResultPath);
            }

            using (var writer = File.CreateText(Path.Combine(ResultPath, MethodBase.GetCurrentMethod().Name + ".txt")))
            {
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("OnProcessSpellCast (" + new StackTrace().GetFrame(1).GetMethod().Name + "), analysing properties...");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                writer.Write(" - Sender type: ");
                writer.Flush();
                writer.WriteLine(sender.GetType().Name);
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing all public properties of sender");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in sender.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(sender, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing all public properties of GameObjectProcessSpellCastEventArgs");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in args.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(args, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("All properties analyzed, analyzing underlaying SData");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in args.SData.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(args.SData, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing OnProcessSpellCast complete!");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine();
            }
        }
开发者ID:tswierkot,项目名称:EloBuddy-Addons,代码行数:55,代码来源:Program.cs

示例7: OnPlayAnimation

        private static void OnPlayAnimation(Obj_AI_Base sender, GameObjectPlayAnimationEventArgs args)
        {
            if (!Animation)
            {
                return;
            }

            if (!Directory.Exists(ResultPath))
            {
                Directory.CreateDirectory(ResultPath);
            }

            using (var writer = File.CreateText(Path.Combine(ResultPath, MethodBase.GetCurrentMethod().Name + ".txt")))
            {
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("OnPlayAnimation, analysing properties...");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                writer.Write(" - Sender type: ");
                writer.Flush();
                writer.WriteLine(sender.GetType().Name);
                writer.Write(" - Animation: ");
                writer.Flush();
                writer.WriteLine(args.Animation);
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing all public properties of sender");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.Flush();
                foreach (var propertyInfo in sender.GetType().GetProperties().Where(propertyInfo => propertyInfo.CanRead && propertyInfo.GetGetMethod() != null))
                {
                    writer.Write(" - " + propertyInfo.Name + ": ");
                    writer.Flush();
                    writer.WriteLine(propertyInfo.GetValue(sender, null));
                    writer.Flush();
                }
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine("Analyzing OnPlayAnimation complete!");
                writer.WriteLine("----------------------------------------------------------------------------------");
                writer.WriteLine();
            }
        }
开发者ID:tswierkot,项目名称:EloBuddy-Addons,代码行数:41,代码来源:Program.cs


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