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


C# Obj_AI_Base.GetAutoAttackDamage方法代码示例

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


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

示例1: OnCast

        private static void OnCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy) return;
            if (SoulBoundHero == null) return;
            // Calculate Damage
            if ((!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()) && args.Target != null && args.Target.NetworkId == SoulBoundHero.NetworkId)
            {
                // Calculate arrival time and damage
                _incomingDamage.Add(SoulBoundHero.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time, (float)sender.GetAutoAttackDamage(SoulBoundHero));
            }
            // Sender is a hero
            else if (sender is Obj_AI_Hero)
            {
                var attacker = (Obj_AI_Hero)sender;
                var slot = attacker.GetSpellSlot(args.SData.Name);

                if (slot == SpellSlot.Unknown) return;

                if (slot == attacker.GetSpellSlot("SummonerDot") && args.Target != null && args.Target.NetworkId == SoulBoundHero.NetworkId)
                    _instantDamage.Add(Game.Time + 2, (float)attacker.GetSummonerSpellDamage(SoulBoundHero, LeagueSharp.Common.Damage.SummonerSpell.Ignite));

                else if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R) &&
                         ((args.Target != null && args.Target.NetworkId == SoulBoundHero.NetworkId) ||
                          args.End.Distance(SoulBoundHero.ServerPosition) < Math.Pow(args.SData.LineWidth, 2)))
                    _instantDamage.Add(Game.Time + 2, (float)attacker.GetSpellDamage(SoulBoundHero, slot));
            }
        }
开发者ID:KallenStadtfeldGeass,项目名称:KallenSharp,代码行数:27,代码来源:SoulBoundDamage.cs

示例2: OnCast

        private static void OnCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy) return;
            if (Properties.SoulBoundHero == null) return;
            // Calculate Damage
            if ((!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()) && args.Target != null && args.Target.NetworkId == Properties.SoulBoundHero.NetworkId)
            {
                // Calculate arrival time and damage
                _incomingDamage.Add(Properties.SoulBoundHero.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time, (float)sender.GetAutoAttackDamage(Properties.SoulBoundHero));
            }
            // Sender is a hero
            else if (sender is Obj_AI_Hero)
            {
                var attacker = (Obj_AI_Hero)sender;
                var slot = attacker.GetSpellSlot(args.SData.Name);

                if (slot != SpellSlot.Unknown)
                {
                    if (slot == attacker.GetSpellSlot("SummonerDot") && args.Target != null && args.Target.NetworkId == Properties.SoulBoundHero.NetworkId)
                        _instantDamage.Add(Game.Time + 2, (float)attacker.GetSummonerSpellDamage(Properties.SoulBoundHero, Damage.SummonerSpell.Ignite));

                    // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags
                    else if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R) &&
                        ((args.Target != null && args.Target.NetworkId == Properties.SoulBoundHero.NetworkId) ||
                        args.End.Distance(Properties.SoulBoundHero.ServerPosition) < Math.Pow(args.SData.LineWidth, 2)))
                        _instantDamage.Add(Game.Time + 2, (float)attacker.GetSpellDamage(Properties.SoulBoundHero, slot));

                }
            }

            if (!Properties.MainMenu.Item("bBST").GetValue<bool>() || !Properties.Champion.R.IsReady()) return;

            var buffName = "";
            switch (Properties.SoulBoundHero.ChampionName)
            {
                case "Blitzcrank":
                    buffName = "rocketgrab2";
                    break;

                case "Skarner":
                    buffName = "skarnerimpale";
                    break;

                case "TahmKench":
                    buffName = "tahmkenchwdevoured";
                    break;
            }

            if (buffName.Length <= 0) return;

            if (Properties.SoulBoundHero.Distance(Properties.PlayerHero) > Orbwalking.GetRealAutoAttackRange(Properties.PlayerHero)) return;

            foreach (var target in HeroManager.Enemies.Where(t => t.IsValid && t.HasBuff(buffName)))
            {
                if (target.Distance(Properties.PlayerHero) < Properties.MainMenu.Item("sBST").GetValue<Slider>().Value) continue;
                Properties.Champion.R.Cast();
                return;
            }
        }
开发者ID:prok1lls,项目名称:KallenSharp,代码行数:59,代码来源:SoulBound.cs

示例3: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            foreach (var ally in EntityManager.Heroes.Allies.Where(ally => E.IsInRange(ally) && !ally.IsZombie))
            {
                if (sender.IsEnemy)
                {
                    // Calculations to save your souldbound
                    if (ally != null && Settings.UseE)
                    {
                            // Auto attacks
                            if ((!(sender is AIHeroClient) || args.SData.IsAutoAttack()) && args.Target != null && args.Target.NetworkId == ally.NetworkId)
                            {
                                // Calculate arrival time and damage
                                IncDamage[ally.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time] = sender.GetAutoAttackDamage(ally);
                            }
                            // Sender is a hero
                            else
                            {
                                var attacker = sender as AIHeroClient;
                                if (attacker != null)
                                {
                                var slot = attacker.GetSpellSlotFromName(args.SData.Name);

                                if (slot != SpellSlot.Unknown)
                                {
                                    if (slot == attacker.GetSpellSlotFromName("SummonerDot") && args.Target != null && args.Target.NetworkId == ally.NetworkId)
                                    {
                                        // Ingite damage (dangerous)
                                        InstDamage[Game.Time + 2] = attacker.GetSummonerSpellDamage(ally, DamageLibrary.SummonerSpells.Ignite);
                                    }
                                    else
                                    {
                                        switch (slot)
                                        {
                                            case SpellSlot.Q:
                                            case SpellSlot.W:
                                            case SpellSlot.E:
                                            case SpellSlot.R:

                                                if ((args.Target != null && args.Target.NetworkId == ally.NetworkId) || args.End.Distance(ally.ServerPosition) < Math.Pow(args.SData.LineWidth, 2))
                                                {
                                                    // Instant damage to target
                                                    InstDamage[Game.Time + 2] = attacker.GetSpellDamage(ally, slot);
                                                }

                                                break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:ZiiMs,项目名称:EloBuddy,代码行数:55,代码来源:AutoShield.cs

示例4: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!Settings.useHeal)
                return;
            if (sender.IsEnemy || sender.IsMonster)
            {
                if ((sender.IsMinion || sender.IsMonster || args.SData.IsAutoAttack()) && args.Target != null)
                {
                    for (int i = 0; i < EntityManager.Heroes.Allies.Count; i++)
                    {
                        if (args.Target.NetworkId == EntityManager.Heroes.Allies[i].NetworkId)
                        {
                            IncDamage[i][EntityManager.Heroes.Allies[i].ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time] = sender.GetAutoAttackDamage(EntityManager.Heroes.Allies[i]);
                        }
                    }
                }
                else if (!(sender is AIHeroClient))
                {
                    return;
                }
                else
                {
                    var attacker = sender as AIHeroClient;
                    if (attacker != null)
                    {
                        var slot = attacker.GetSpellSlotFromName(args.SData.Name);

                        if (slot != SpellSlot.Unknown)
                        {
                            if (slot == attacker.GetSpellSlotFromName("SummonerDot") && args.Target != null)
                            {
                                for (int i = 0; i < EntityManager.Heroes.Allies.Count; i++)
                                {
                                    if (args.Target.NetworkId == EntityManager.Heroes.Allies[i].NetworkId)
                                    {
                                        InstDamage[i][Game.Time + 2] = attacker.GetSummonerSpellDamage(EntityManager.Heroes.Allies[i], DamageLibrary.SummonerSpells.Ignite);
                                    }
                                }
                            }
                            else
                            {
                                for (int i = 0; i < EntityManager.Heroes.Allies.Count; i++)
                                {
                                    if ((args.Target != null && args.Target.NetworkId == EntityManager.Heroes.Allies[i].NetworkId) || args.End.Distance(EntityManager.Heroes.Allies[i].ServerPosition) < Math.Pow(args.SData.LineWidth, 2))
                                    {
                                        InstDamage[i][Game.Time + 2] = attacker.GetSpellDamage(EntityManager.Heroes.Allies[i], slot);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:v4ever1luv,项目名称:kid,代码行数:54,代码来源:SaveMePls.cs

示例5: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy)
            {
                if ((!(sender is AIHeroClient) || args.SData.IsAutoAttack()) && args.Target != null && args.Target.NetworkId == Player.Instance.NetworkId)
                {
                    IncDamage[Player.Instance.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time] = sender.GetAutoAttackDamage(Player.Instance);
                }
                else if (!(sender is AIHeroClient))
                {
                    return;
                }
                else
                {
                    var attacker = sender as AIHeroClient;
                    if (attacker != null)
                    {
                        var slot = attacker.GetSpellSlotFromName(args.SData.Name);

                        if (slot != SpellSlot.Unknown)
                        {
                            if (slot == attacker.GetSpellSlotFromName("SummonerDot") && args.Target != null && args.Target.NetworkId == Player.Instance.NetworkId)
                            {
                                InstDamage[Game.Time + 2] = attacker.GetSummonerSpellDamage(Player.Instance, DamageLibrary.SummonerSpells.Ignite);
                            }
                            else
                            {
                                switch (slot)
                                {
                                    case SpellSlot.Q:
                                    case SpellSlot.W:
                                    case SpellSlot.E:
                                    case SpellSlot.R:

                                        if ((args.Target != null && args.Target.NetworkId == Player.Instance.NetworkId) || args.End.Distance(Player.Instance.ServerPosition) < Math.Pow(args.SData.LineWidth, 2))
                                        {
                                            // Instant damage to target
                                            InstDamage[Game.Time + 2] = attacker.GetSpellDamage(Player.Instance, slot);
                                        }

                                        break;
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:tmvpf12,项目名称:EloBuddy,代码行数:48,代码来源:SaveMePls.cs

示例6: Obj_AI_Base_OnProcessSpellCast

        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!(sender is Obj_AI_Hero) || !(args.Target is Obj_AI_Hero))
                return;
            var senderH = sender as Obj_AI_Hero;
            var targetH = args.Target as Obj_AI_Hero;
            var damage = Orbwalking.IsAutoAttack(args.SData.Name) ? sender.GetAutoAttackDamage(targetH) : GetDamage(senderH, targetH, senderH.GetSpellSlot(args.SData.Name));

            if (damage > targetH.Health + 15)
            {
                if (OnSpellWillKill != null)
                {
                    OnSpellWillKill(senderH, targetH, args.SData);
                }
            }
        }
开发者ID:DZ191,项目名称:LeagueSharp_InDev,代码行数:16,代码来源:DamagePrediction.cs

示例7: OnProcessSpellCast

        //credits to hellsing, and jquery
        public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy)
            {
                if (_connectedAlly != null && Program.R.IsReady())
                {
                    if ((!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()) && args.Target != null &&
                        args.Target.NetworkId == _connectedAlly.NetworkId)
                    {
                        _incomingDamage.Add(
                            _connectedAlly.ServerPosition.Distance(sender.ServerPosition)/args.SData.MissileSpeed +
                            Game.Time, (float) sender.GetAutoAttackDamage(_connectedAlly));
                    }
                    else if (sender is Obj_AI_Hero)
                    {
                        var attacker = (Obj_AI_Hero) sender;
                        var slot = attacker.GetSpellSlot(args.SData.Name);

                        if (slot != SpellSlot.Unknown)
                        {
                            if (slot == attacker.GetSpellSlot("SummonerDot") && args.Target != null &&
                                args.Target.NetworkId == _connectedAlly.NetworkId)
                            {
                                _instantDamage.Add(Game.Time + 2,
                                    (float) attacker.GetSummonerSpellDamage(_connectedAlly, Damage.SummonerSpell.Ignite));
                            }
                            else if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R) &&
                                     ((args.Target != null && args.Target.NetworkId == _connectedAlly.NetworkId) ||
                                      args.End.Distance(_connectedAlly.ServerPosition) <
                                      Math.Pow(args.SData.LineWidth, 2)))
                            {
                                _instantDamage.Add(Game.Time + 2, (float) attacker.GetSpellDamage(_connectedAlly, slot));
                            }
                        }
                    }
                }
            }

            if (sender.IsMe)
            {
                if (args.SData.Name == "KalistaExpungeWrapper")
                {
                    Utility.DelayAction.Add(250, Orbwalking.ResetAutoAttackTimer);
                }
            }
        }
开发者ID:cttbot,项目名称:LeagueSharp,代码行数:47,代码来源:SoulboundSaver.cs

示例8: Obj_AI_Base_OnProcessSpellCast

        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!(sender is Obj_AI_Hero) || !(args.Target is Obj_AI_Hero))
                return;
            var senderH = sender as Obj_AI_Hero;
            var targetH = args.Target as Obj_AI_Hero;
            var damage = Orbwalking.IsAutoAttack(args.SData.Name)?sender.GetAutoAttackDamage(targetH):GetDamage(senderH,targetH, senderH.GetSpellSlot(args.SData.Name));

            //DebugHelper.AddEntry("Damage to "+targetH.ChampionName+" from spell "+args.SData.Name+" -> "+senderH.ChampionName+" ("+senderH.GetSpellSlot(args.SData.Name)+")",damage.ToString());

            if (damage > targetH.Health + 20)
            {
                if (OnSpellWillKill != null)
                {
                    OnSpellWillKill(senderH, targetH,args.SData);
                }
            }
        }
开发者ID:ShineSharp,项目名称:LeagueSharp-5,代码行数:18,代码来源:DamagePrediction.cs

示例9: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!CConfig.ConfigMenu.Item("useUltimate").GetValue<bool>() || !R.IsReady() || !sender.IsEnemy)
                return;

            // Calculations to smart save allies
            foreach (var ally in HeroManager.Allies)
            {
                //Auto Attack
                if ((!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()) && args.Target != null &&
                    args.Target.NetworkId == ally.NetworkId && !ally.IsBlocked())
                {
                    // Calculate arrival time and damage
                    _incomingDamage.Add(
                        ally.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time,
                        (float)sender.GetAutoAttackDamage(ally));
                }

                // Sender is a hero
                else if (sender is Obj_AI_Hero)
                {
                    var attacker = (Obj_AI_Hero)sender;
                    var slot = attacker.GetSpellSlot(args.SData.Name);

                    if (slot != SpellSlot.Unknown)
                    {
                        if (slot == attacker.GetSpellSlot("SummonerDot") && args.Target != null &&
                            args.Target.NetworkId == ally.NetworkId && !ally.IsBlocked())
                        {
                            // Ingite damage (dangerous)
                            _instantDamage.Add(Game.Time + 2,
                                (float)attacker.GetSummonerSpellDamage(ally, Damage.SummonerSpell.Ignite));
                        }
                        else if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R) &&
                                 ((args.Target != null && args.Target.NetworkId == ally.NetworkId) ||
                                  args.End.Distance(ally.ServerPosition) < Math.Pow(args.SData.LineWidth, 2)))
                        {
                            // Instant damage to target
                            _instantDamage.Add(Game.Time + 2, (float)attacker.GetSpellDamage(ally, slot));
                        }
                    }
                }
            }
        }
开发者ID:GitMiester,项目名称:L-Assemblies,代码行数:44,代码来源:CUltimate.cs

示例10: Obj_AI_Base_OnProcessSpellCast

        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (OnSpellDmg == null)
                return;

            if (!(sender is Obj_AI_Hero))
                return;

            if (!(args.Target is Obj_AI_Hero))
                return;

            var _sender = sender as Obj_AI_Hero;
            var target = args.Target as Obj_AI_Hero;
            var dmg = Orbwalking.IsAutoAttack(args.SData.Name) ? (float)sender.GetAutoAttackDamage(target) : GetDmg(_sender, target, _sender.GetSpellSlot(args.SData.Name));

            if (dmg != 0)
            {
                OnSpellDmg(_sender, target, dmg);
            }
        }
开发者ID:fgpmaia123,项目名称:KaiserSharp,代码行数:20,代码来源:DamagePrediction.cs

示例11: Obj_AI_Base_OnProcessSpellCast

        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy)
            {
                // Calculations to save your souldbound
                if (SoulBound != null && R.IsEnabled("misc"))
                {
                    // Auto attacks
                    if ((!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()) && args.Target != null && args.Target.NetworkId == SoulBound.NetworkId)
                    {
                        // Calculate arrival time and damage
                        _incomingDamage.Add(SoulBound.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed + Game.Time, (float)sender.GetAutoAttackDamage(SoulBound));
                    }
                    // Sender is a hero
                    else if (sender is Obj_AI_Hero)
                    {
                        var attacker = (Obj_AI_Hero)sender;
                        var slot = attacker.GetSpellSlot(args.SData.Name);

                        if (slot != SpellSlot.Unknown)
                        {
                            if (slot == attacker.GetSpellSlot("SummonerDot") && args.Target != null && args.Target.NetworkId == SoulBound.NetworkId)
                            {
                                // Ingite damage (dangerous)
                                _instantDamage.Add(Game.Time + 2, (float)attacker.GetSummonerSpellDamage(SoulBound, Damage.SummonerSpell.Ignite));
                            }
                            else if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R) &&
                                ((args.Target != null && args.Target.NetworkId == SoulBound.NetworkId) ||
                                args.End.Distance(SoulBound.ServerPosition) < Math.Pow(args.SData.LineWidth, 2)))
                            {
                                // Instant damage to target
                                _instantDamage.Add(Game.Time + 2, (float)attacker.GetSpellDamage(SoulBound, slot));
                            }
                        }
                    }
                }
            }
        }
开发者ID:qktlfflzk,项目名称:Backup5.4,代码行数:38,代码来源:SoulBoundSaver.cs

示例12: OnObjAiBaseProcessSpellCast

 private void OnObjAiBaseProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     try
     {
         if (sender.IsMe)
         {
             if (args.SData.Name == "KalistaExpungeWrapper")
             {
                 Orbwalking.ResetAutoAttackTimer();
             }
         }
         if (!sender.IsEnemy || SoulBound.Unit == null || R.Level == 0 ||
             !Menu.Item(Menu.Name + ".ultimate.save").GetValue<bool>())
         {
             return;
         }
         if (args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId &&
             (!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()))
         {
             SoulBound.Add(
                 SoulBound.Unit.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed +
                 Game.Time, (float) sender.GetAutoAttackDamage(SoulBound.Unit));
         }
         else
         {
             var hero = sender as Obj_AI_Hero;
             if (hero != null)
             {
                 var slot = hero.GetSpellSlot(args.SData.Name);
                 if (slot != SpellSlot.Unknown)
                 {
                     var damage = 0f;
                     if (args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId &&
                         slot == hero.GetSpellSlot("SummonerDot"))
                     {
                         damage =
                             (float) hero.GetSummonerSpellDamage(SoulBound.Unit, Damage.SummonerSpell.Ignite);
                     }
                     else if ((slot == SpellSlot.Q || slot == SpellSlot.W || slot == SpellSlot.E ||
                               slot == SpellSlot.R) &&
                              ((args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId) ||
                               args.End.Distance(SoulBound.Unit.ServerPosition) <
                               Math.Pow(args.SData.LineWidth, 2)))
                     {
                         damage = (float) hero.GetSpellDamage(SoulBound.Unit, slot);
                     }
                     if (damage > 0)
                     {
                         SoulBound.Add(Game.Time + 2, damage);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
开发者ID:lukasi273,项目名称:SFX-5.12-update,代码行数:59,代码来源:Kalista.cs

示例13: DamageMaker

            public DamageMaker(Obj_AI_Base sourceIn, Obj_AI_Base targetIn, GameObject missleIn, SpellData dataIn, bool meleeIn = false)
            {
                source = sourceIn;
                target = targetIn;
                missle = missleIn;
                sData = dataIn;
                melee = !meleeIn;
                createdTick = now;
                isAutoAtack = sData.IsAutoAttack();

                if (isAutoAtack)
                {

                    dealDamage = (float) source.GetAutoAttackDamage(target, true);
                    if (source.IsMelee)
                        cycle = (int) (source.AttackDelay*1000);
                    else
                    {
                        //var dist = source.Distance(target);
                        cycle = (int)((source.AttackDelay * 1000)) /*+ (dist*1000)/sData.MissileSpeed)*/;
                        //Console.WriteLine("cycle: " + cycle);
                    }
                    //Console.WriteLine("cycle: " + source.AttackSpeedMod);
                }
                else
                {
                    cycle = 0;
                    if (source is Obj_AI_Hero)
                    {
                        var tSpell = TargetSpellDatabase.GetByName(sData.Name);
                        if (tSpell == null)
                        {
                            //Console.WriteLine("Unknown targeted spell: " + sData.Name);
                            dealDamage = 0;
                        }
                        else
                        {
                            try
                            {

                                dealDamage = (float)((Obj_AI_Hero)source).GetSpellDamage(target, tSpell.Spellslot);
                            }
                            catch (Exception)
                            {
                                dealDamage = 0;
                            }
                        }
                    }
                    else
                    {
                        dealDamage = 0;
                    }
                }
            }
开发者ID:jmj8537,项目名称:GoodGuyJodu,代码行数:54,代码来源:HealthDeath.cs

示例14: ObjAiBaseOnOnProcessSpellCast

        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero
                || !Orbwalking.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base))
            {
                return;
            }

            var target = (Obj_AI_Base)args.Target;
            ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender,
                target,
                Utils.GameTimeTickCount - Game.Ping / 2,
                sender.AttackCastDelay * 1000,
                sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
                sender.IsMelee() ? int.MaxValue : (int)args.SData.MissileSpeed,
                (float)sender.GetAutoAttackDamage(target, true));
            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:21,代码来源:HealthPrediction.cs

示例15: Obj_AI_Hero_OnProcessSpellCast

        void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            //Patented by XcxooxL
            if (!sender.IsEnemy || !sender.IsValidTarget() || !sender.IsVisible) return;

            if (args.Target != null && !args.Target.IsAlly) return;
                double damage = 0;
                //if it is an Auto Attack !
            if (args.SData.IsAutoAttack())
            {
                var Target = args.Target as Obj_AI_Hero;
                if (Target == null)
                    return; //must be a champion
                if (args.SData.Name.ToLower().Contains("crit"))
                {
                    damage += sender.GetAutoAttackDamage(Target) * 2;
                    //Console.WriteLine("Critical " + damage);
                    if (sender.InventoryItems.Any(item => item.Id.Equals(3031)))
                    {
                        Console.WriteLine("Infinity Edge");
                        damage += damage * 1.25;
                    }
                    //Infinity edge
                }
                else
                {
                    damage += sender.GetAutoAttackDamage(Target, true);
                }
                damage += 2; //to be on the safe side
                Add(Target, damage, sender.Distance(Target) / args.SData.MissileSpeed + 1 / sender.AttackDelay);
                Console.WriteLine(
                    "Target : " + Target.Name + "Damage : " + damage + " Time To Hit : " +
                    sender.Distance(Target) / args.SData.MissileSpeed * 1000);

            }
            else //if its a Spell
            {
                float delay = 0;
                var missileSpeed = args.SData.MissileSpeed;
                foreach (var spellInfo in
                    SpellDatabase.Spells.Where(spellInfo => spellInfo.spellName.Equals(args.SData.Name)))
                {
                    if (spellInfo.spellType.Equals(SpellType.Line))
                    {
                        _myPoly = new Geometry.Polygon.Rectangle(
                            args.Start, args.Start.Extend(args.End, spellInfo.range), spellInfo.radius);
                    }
                    else if (spellInfo.spellType.Equals(SpellType.Circular))
                    {

                        var pos = sender.Distance(args.End) > spellInfo.range
                            ? sender.Position.Extend(args.End, spellInfo.range)
                            : args.End;
                        _myPoly = new Geometry.Polygon.Circle(pos, spellInfo.radius);
                    }
                    missileSpeed = spellInfo.projectileSpeed;
                    delay += spellInfo.spellDelay;
                    break;
                }

                //Patented by xcxooxl ALL OF THIS IS MINE ! YOU WANT IT? CREDIT ME!

                if (sender is Obj_AI_Hero)
                {
                    var enemy = sender as Obj_AI_Hero;
                    foreach (var ally in TrackList)
                    {
                        var timeToHit = delay + ally.Distance(args.Start) / missileSpeed * 1000 +
                                        args.SData.ChannelDuration + args.SData.DelayTotalTimePercent * -1;
                        if (args.SData.TargettingType.Equals(SpellDataTargetType.Unit)) //Targeted
                        {
                            damage += enemy.GetDamageSpell(args.Target as Obj_AI_Base, args.Slot).CalculatedDamage;
                            Add(ally, damage, timeToHit);
                        }

                        Console.WriteLine(
                            "Spellname" + args.SData.Name + " Time to hit " + timeToHit + "MissileSpeed " + missileSpeed);

                        var futurePos = Prediction.GetPrediction(ally, timeToHit / 1000).UnitPosition;
                        futurePosCircle = new Geometry.Polygon.Circle(futurePos, 125);
                        if (_myPoly.IsInside(futurePos))
                        {
                            damage += enemy.GetDamageSpell(ally, args.Slot).CalculatedDamage;
                            Add(ally, damage, timeToHit);
                        }
                        Utility.DelayAction.Add(
                            (int) (timeToHit + 1200), () =>
                            {
                                futurePosCircle = null;
                                _myPoly = null;
                            }); //stop drawing polygons

                    }
                }
            }

            //Patented by XcxooxL
        }
开发者ID:hahahalol,项目名称:ExoryREPO,代码行数:98,代码来源:DamageHandler.cs


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