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


C# Obj_AI_Base.TotalShieldHealth方法代码示例

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


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

示例1: DrawLine

        private static void DrawLine(Obj_AI_Base unit)
        {
            var damage = _damageToUnit(unit);
            if (damage <= 0) return;

            var barPos = unit.HPBarPosition;

            //Get remaining HP after damage applied in percent and the current percent of health
            var percentHealthAfterDamage = Math.Max(0, unit.TotalShieldHealth() - damage) / unit.MaxHealth;
            var currentHealthPercentage = unit.TotalShieldHealth() / unit.MaxHealth;

            //Calculate start and end point of the bar indicator
            var startPoint = barPos.X + _xOffset + (percentHealthAfterDamage * _width);
            var endPoint = barPos.X + _xOffset + (currentHealthPercentage * _width);
            var yPos = barPos.Y + _yOffset;

            //Create a new transparent color based on the type of unit
            var color = unit is AIHeroClient ? EnemyColor : JungleColor;
            var transparentColor = Color.FromArgb(175, color);

            //Draw the line
            Drawing.DrawLine(startPoint, yPos, endPoint, yPos, _height, transparentColor);

            //Debug
            //Drawing.DrawLine(barPos.X + _xOffset, yPos, barPos.X + _xOffset + _width, yPos, _height, transparentColor);
        }
开发者ID:Monstertje,项目名称:EloBuddy,代码行数:26,代码来源:DamageIndicator.cs

示例2: DrawLine

        private static void DrawLine(Obj_AI_Base unit)
        {
            var damage = _damageToUnit(unit);
            if (damage <= 0) return;

            var barPos = unit.HPBarPosition;

            var percentHealthAfterDamage = Math.Max(0, unit.TotalShieldHealth() - damage) /
                                           (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield);
            var yPos = barPos.Y + _yOffset;
            var currentHealthPercentage = unit.TotalShieldHealth() /
                                          (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield);

            var startPoint = barPos.X + _xOffset + percentHealthAfterDamage * _width;
            var endPoint = barPos.X + _xOffset + currentHealthPercentage * _width;

            Drawing.DrawLine(startPoint, yPos, endPoint, yPos, _height, Color.MediumVioletRed);

            if (damage > unit.Health)
            {
                Text.X = (int)barPos.X + _xOffset + 130;
                Text.Y = (int)barPos.Y + _xOffset - 13;
                Text.TextValue = "KILLABLE: " + (unit.Health - damage);
                Text.Draw();
            }
            Drawing.DrawLine(startPoint, yPos, startPoint, yPos + _height, 2, Color.Lime);
        }
开发者ID:chienhao10,项目名称:Buddy-dev-1,代码行数:27,代码来源:DamageIndicator.cs

示例3: Execute

        public static void Execute()
        {
            if (Environment.TickCount - SpellManager.LastLaneClear < Game.Ping * 2)
                return;

            int delay = 0;
            if (ConfigList.Farm.FarmQ && SpellManager.Q.IsReady() && Player.Instance.ManaPercent >= ManaManager.LaneClearQ_Mana && (Player.Instance.HasBuff("RyzeQIconFullCharge") || Player.Instance.HasBuff("RyzeQIconNoCharge")))
            {
                var target = new Obj_AI_Base();
                target = Extesions.Entities.GetJungleMinion(SpellManager.Q.Range);
                switch (target != null ? true : false)
                {
                    case true: break; // jungle clear
                    case false: // lane clear
                        {
                            target = EntityManager.MinionsAndMonsters.EnemyMinions.Where(minion => minion.IsValidTarget(SpellManager.Q.Range)).FirstOrDefault();
                            break;
                        }
                }
                if (target != null)
                    if (target.TotalShieldHealth() <= Damage.GetQDamage(target) || target.TotalShieldHealth() / Damage.GetQDamage(target) > 2)
                    {
                        var predQ = SpellManager.Q.GetPrediction(target);
                        if (predQ.HitChance >= ChanceHit.GetHitChance(ChanceHit.LaneClearMinToUseQ))
                            Core.DelayAction(() => SpellManager.Q.Cast(predQ.CastPosition), delay);
                    }
            }
            if (ConfigList.Farm.FarmE && SpellManager.E.IsReady() && Player.Instance.ManaPercent >= ManaManager.LaneClearE_Mana && !Player.Instance.HasBuff("RyzeQIconFullCharge"))
            {
                var target = new Obj_AI_Base();
                target = Extesions.Entities.GetJungleMinion(SpellManager.E.Range);
                switch (target != null ? true : false)
                {
                    case true: // jungle clear
                        {
                            var monsters = EntityManager.MinionsAndMonsters.Monsters.Where(monster => monster.IsValidTarget(SpellManager.E.Range));
                            if (!ConfigList.Farm.FarmEIgnore && monsters.Count() < ConfigList.Farm.FarmECount)
                                return;
                            break;
                        }
                    case false: // lane clear
                        {
                            var minions = EntityManager.MinionsAndMonsters.EnemyMinions.Where(minion => minion.IsValidTarget(SpellManager.E.Range));
                            if (minions.Count() < ConfigList.Farm.FarmECount)
                                return;

                            target = minions.FirstOrDefault();
                            break;
                        }
                }
                if (target != null)
                    SpellManager.E.Cast(target);
            }
            SpellManager.LastLaneClear = Environment.TickCount;
        }
开发者ID:,项目名称:,代码行数:55,代码来源:

示例4: IsRendKillable

        public static bool IsRendKillable(Obj_AI_Base target, float? damage = null)
        {
            // Validate unit
            if (target == null || !target.IsValidTarget() || !target.HasRendBuff())
            {
                return false;
            }

            // Take into account all kinds of shields
            var totalHealth = target.TotalShieldHealth();

            var hero = target as AIHeroClient;
            if (hero != null)
            {
                // Validate that target has no undying buff or spellshield
                if (hero.HasUndyingBuff() || hero.HasSpellShield())
                {
                    return false;
                }

                // Take into account Blitzcranks passive
                if (hero.ChampionName == "Blitzcrank" && !target.HasBuff("BlitzcrankManaBarrierCD") && !target.HasBuff("ManaBarrier"))
                {
                    totalHealth += target.Mana / 2;
                }
            }

            return (damage ?? GetRendDamage(target)) > totalHealth;
        }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例5: DrawIndicator

        private static void DrawIndicator(Obj_AI_Base target)
        {
            var damage = Damage.GetTotalDamage(target);
            if (damage <= 0)
                return;

            var barPos = target.HPBarPosition;

            var percentHealthAfterDamage = Math.Max(0, target.TotalShieldHealth() - damage) /
                                           (target.MaxHealth + target.AllShield + target.AttackShield + target.MagicShield);
            var currentHealthPercentage = target.TotalShieldHealth() /
                                          (target.MaxHealth + target.AllShield + target.AttackShield + target.MagicShield);

            var startX = barPos.X + 2 + percentHealthAfterDamage * 104;
            var endX = barPos.X + 2 + currentHealthPercentage * 104;
            var y = barPos.Y + 10;

            Drawing.DrawLine((float)startX, y, (float)endX, y, 10, Color.OrangeRed);
        }
开发者ID:,项目名称:,代码行数:19,代码来源:

示例6: OnUnkillableMinion

 private void OnUnkillableMinion(Obj_AI_Base target, Orbwalker.UnkillableMinionArgs args)
 {
     if (UnkillableE.CurrentValue && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit)))
     {
         // Check if target is in E range and killable with E
         if (E.IsReady() && E.IsInRange(target) && !IsDefileActive && target.TotalShieldHealth() < Player.Instance.GetSpellDamage(target, E.Slot))
         {
             // Cast E
             CastDefilePulse();
         }
     }
 }
开发者ID:,项目名称:,代码行数:12,代码来源:

示例7: GetComboDamage

        private static DamageInfo GetComboDamage(Obj_AI_Base target, bool q, bool w, bool e, bool r)
        {
            var comboDamage = 0f;
            var manaWasted = 0f;
            if (target.IsValidTarget())
            {
                if (w && IsW1 && W.IsReady())
                {
                    manaWasted += MyHero.Spellbook.GetSpell(SpellSlot.W).SData.Mana;
                }
                if (w && e)
                {
                    comboDamage += Damage(target, E.Slot);
                }
                if (w && q)
                {
                    comboDamage += 0.5f * Damage(target, Q.Slot);
                }
                if (r && q)
                {
                    comboDamage += 0.5f * Damage(target, Q.Slot);
                }

                if (q)
                {
                    comboDamage += Damage(target, Q.Slot);
                    manaWasted += MyHero.Spellbook.GetSpell(SpellSlot.Q).SData.Mana;
                }
                if (e)
                {
                    comboDamage += Damage(target, E.Slot);
                    manaWasted += MyHero.Spellbook.GetSpell(SpellSlot.E).SData.Mana;
                }
                if (Ignite != null && Ignite.IsReady())
                {
                    comboDamage += MyHero.GetSummonerSpellDamage(target, DamageLibrary.SummonerSpells.Ignite);
                }
                if (r)
                {
                    comboDamage += Damage(target, R.Slot);
                    comboDamage += comboDamage * (20f + R.Level * 10) / 100f;
                    manaWasted += MyHero.Spellbook.GetSpell(SpellSlot.R).SData.Mana;
                }
                if (TargetHaveR(target))
                {
                    comboDamage += comboDamage * (20f + R.Level * 10) / 100f;
                }
                comboDamage += MyHero.GetAutoAttackDamage(target, true);
            }
            comboDamage += Passive(target, target.TotalShieldHealth() - comboDamage);
            comboDamage = comboDamage * Overkill;
            return new DamageInfo(comboDamage, manaWasted);
        }
开发者ID:tramyeu,项目名称:EloBuddy,代码行数:53,代码来源:Program.cs

示例8: CheckRKillable

        internal static void CheckRKillable(Obj_AI_Base target)
        {
            KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target);
            if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId])
            {
                var distance = Vector3.Distance(Util.MyHero.Position, target.Position);
                R.Speed = (int)InitialSpeed;
                if (distance >= ChangerSpeedDistance)
                {
                    var travelTime = ChangerSpeedDistance / InitialSpeed + (distance - ChangerSpeedDistance) / FinalSpeed;
                    R.Speed = (int)(distance / travelTime);
                }
                var pred = R.GetPrediction(target);
                var hitchance = predi.GetHitChance(SpellSlot.R, 20000, SkillShotType.Linear, 600, 1700, 140,Player.Instance.ServerPosition,target);
                var firstHit =
                    pred.GetCollisionObjects<AIHeroClient>()
                        .OrderBy(h => Util.MyHero.Distance(h, true))
                        .FirstOrDefault() ?? target;
                KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target,
                    firstHit.IdEquals(target) ? 1 : 2);
                if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId] && Util.MyHero.Distance(target, true) <= RRangeSqr)
                {
                    KillSteal.RKillableBases.Add(target);

                    if (pred.HitChance >= HitChance.Low && hitchance >= MenuManager.PredR() &&
                        firstHit.Distance(target, true) <= (225 + target.BoundingRadius).Pow())
                    {
                        if ((KillSteal.Menu.CheckBox("R") /*&& target.WillBeHittedByR()*/ &&
                             !MyTargetSelector.PowPowTarget.IdEquals(target) && target.CountAlliesInRange(500) == 0) || MenuManager.TapKeyPressed)
                        {
                            KillSteal.RHittableBases.Add(pred.CastPosition);
                        }
                    }
                }
            }
        }
开发者ID:giaanthunder,项目名称:EloBuddy,代码行数:36,代码来源:SpellManager.cs

示例9: IsKillable

 public bool IsKillable(Obj_AI_Base target)
 {
     return target.TotalShieldHealth() + target.HPRegenRate * 2 <= GetDamage(target);
 }
开发者ID:jachicao,项目名称:EloBuddy,代码行数:4,代码来源:SpellBase.cs

示例10: DrawLine

        private static void DrawLine(Obj_AI_Base unit)
        {
            var damage = _damageToUnit(unit);
            if (damage <= 0) return;

            var barPos = unit.HPBarPosition;

            //Get remaining HP after damage applied in percent and the current percent of health
            var percentHealthAfterDamage = Math.Max(0, unit.TotalShieldHealth() - damage)/
                                           (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield);
            var currentHealthPercentage = unit.TotalShieldHealth()/
                                          (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield);

            //Calculate start and end point of the bar indicator
            var startPoint = barPos.X + _xOffset + percentHealthAfterDamage*_width;
            var endPoint = barPos.X + _xOffset + currentHealthPercentage*_width;
            var yPos = barPos.Y + _yOffset;

            //Draw the line
            Drawing.DrawLine(startPoint, yPos, endPoint, yPos, _height, unit is AIHeroClient ? EnemyColor : JungleColor);
        }
开发者ID:BEEBEEISADOG,项目名称:OKTRAIO,代码行数:21,代码来源:DamageIndicator.cs

示例11: CastR

 private static void CastR(Obj_AI_Base target)
 {
     if (R.IsReady() && target.IsValidTarget())
     {
         var damageI = GetBestCombo(target);
         if (SubMenu["Combo"]["CatchQRPriority"].Cast<CheckBox>().CurrentValue)
         {
             if ((float)_R["EndTime"] > 0)
             {
                 //have active r
                 if (_Q["Object"] != null)
                 {
                     if ((bool)_Q["IsReturning"] &&
                         myHero.Distance((GameObject)_Q["Object"]) < myHero.Distance((Obj_AI_Base)_Q["Target"]))
                     {
                         R.Cast(mousePos);
                     }
                     else
                     {
                         return;
                     }
                 }
                 if (!Q.IsReady() &&
                     (float)_R["EndTime"] - Game.Time <= myHero.Spellbook.GetSpell(R.Slot).Cooldown)
                 {
                     R.Cast(mousePos);
                 }
             }
             if (damageI.Damage >= target.TotalShieldHealth() && mousePos.Distance(target) < myHero.Distance(target))
             {
                 if (damageI.R)
                 {
                     if (myHero.Distance(target) > 400)
                     {
                         R.Cast(mousePos);
                     }
                 }
             }
         }
         else
         {
             if ((float)_R["EndTime"] > 0)
             {
                 if (!Q.IsReady() &&
                     (float)_R["EndTime"] - Game.Time <= myHero.Spellbook.GetSpell(R.Slot).Cooldown)
                 {
                     R.Cast(mousePos);
                 }
             }
             if (damageI.Damage >= target.TotalShieldHealth() && mousePos.Distance(target) < myHero.Distance(target))
             {
                 if (damageI.R)
                 {
                     if (myHero.Distance(target) > 400)
                     {
                         R.Cast(mousePos);
                     }
                 }
             }
         }
     }
 }
开发者ID:mezer123,项目名称:EloBuddy,代码行数:62,代码来源:Program.cs

示例12: getRDamage

 public static double getRDamage(Obj_AI_Base enemy)
 {
     if (enemy == null)
         return 0;
     float bonushp = enemy.TotalShieldHealth() + enemy.HPRegenRate * 2;
     float factor = Player.Instance.Distance(enemy) / 1500;
     if(factor > 1)
         factor = 1;
     if (!GetRCollision().Contains(enemy))
         return 0;
     double dmg = 0;
     {
         //base damage
         dmg = 200 + Player.Instance.Spellbook.GetSpell(SpellSlot.R).Level * 100;
         dmg *= factor;
         //ad scaling
         dmg += ((0.9 * factor) + 0.1) * Player.Instance.TotalAttackDamage;
         //missing HP
         dmg += (0.2 + Player.Instance.Spellbook.GetSpell(SpellSlot.R).Level * 0.05)*(enemy.MaxHealth - enemy.Health);
     }
     return dmg;
 }
开发者ID:TopGunner,项目名称:EloBuddy,代码行数:22,代码来源:SpellManager.cs

示例13: Rlogic

        public static void Rlogic(Obj_AI_Base target)
        {
            if (target == null)
            {
                return;
            }

            var Combomode = Common.orbmode(Orbwalker.ActiveModes.Combo);
            var hits = ComboMenu.slider("Rhit");

            if (Combomode)
            {
                if (ComboMenu.checkbox("RAoe"))
                {
                    var AoeHit = target.CountEnemeis(400) >= hits;
                    var bestaoe = EntityManager.Heroes.Enemies.OrderByDescending(e => e.CountEnemeis(400)).FirstOrDefault(e => e.IsKillable(R.Range) && e.IsKillable() && e.CountEnemeis(400) >= hits);
                    if (AoeHit)
                    {
                        R.Cast(target);
                    }
                    else
                    {
                        if (bestaoe != null)
                        {
                            R.Cast(bestaoe);
                        }
                    }
                }

                if (ComboMenu.checkbox("RFinisher"))
                {
                    var pred = R.GetDamage(target) >= Prediction.Health.GetPrediction(target, Q.CastDelay);
                    var health = R.GetDamage(target) >= target.TotalShieldHealth();

                    if (Q.GetDamage(target) >= Prediction.Health.GetPrediction(target, Q.CastDelay))
                    {
                        return;
                    }

                    if (W.GetDamage(target) >= Prediction.Health.GetPrediction(target, W.CastDelay))
                    {
                        return;
                    }

                    if (E.GetDamage(target) >= Prediction.Health.GetPrediction(target, E.CastDelay))
                    {
                        return;
                    }

                    if (pred || health)
                    {
                        R.Cast(target);
                    }
                }
            }
        }
开发者ID:FireBuddy,项目名称:kappa-s-aio,代码行数:56,代码来源:Brand.cs

示例14: WillDie

 public bool WillDie(Obj_AI_Base target, float damage = 0)
 {
     if (TargetHaveR(target))
     {
         if ((MarkedDamageReceived + damage) * (20f + R.Level * 10) / 100f >= target.TotalShieldHealth())
         {
             EnemyWillDie = true;
             return true;
         }
         return false;
     }
     return false;
 }
开发者ID:BEEBEEISADOG,项目名称:EloBuddy,代码行数:13,代码来源:Zed.cs

示例15: ShouldUseR

        /// <summary>
        ///     Shoulds the use r.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns></returns>
        private static void ShouldUseR(Obj_AI_Base target)
        {
            if (UltMenu["Rtower"].Cast<CheckBox>().CurrentValue && ObjectManager.Player.IsUnderEnemyturret())
            {
                return;
            }

            if (target != null && ObjectManager.Player.GetSpellDamage(target, SpellSlot.R) > target.TotalShieldHealth() + 50 && R.IsReady()
                && !UltMenu["DontUlt" + target.BaseSkinName].Cast<CheckBox>().CurrentValue)
            {
                R.Cast(target);
            }
        }
开发者ID:,项目名称:,代码行数:18,代码来源:


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