Ejemplo n.º 1
0
        private static void OnDraw(EventArgs args)
        {
            // Check if summoner wants circles around smiteables
            if (DrawRange.CurrentValue && (HoldKey.CurrentValue || ToggleKey.CurrentValue))
            {
                foreach (var smiteable in CurrentySmiteable.Where(o => o.IsHPBarRendered).Where(smiteable => Player.Instance.IsInRange(smiteable, SmiteRange * 2)))
                {
                    // Get default out of range color
                    var color = SmiteColorOutOfRange;
                    var width = 1;

                    // Check if player is in range of smiteable
                    if (Player.Instance.IsInRange(smiteable, SmiteRange + Player.Instance.BoundingRadius + smiteable.BoundingRadius))
                    {
                        // In range, apply new color
                        color = SmiteColor;

                        // Check if killable
                        if (smiteable.TotalShieldHealth() <= SmiteDamage)
                        {
                            width = 10;
                        }
                    }

                    // Adjust color
                    if (!SmiteSpell.IsReady())
                    {
                        color   = SmiteColorOutOfRange;
                        color.A = 75;
                    }

                    // Draw the circle around the smiteable
                    Circle.Draw(color, smiteable.BoundingRadius + SmiteRange, width, smiteable);

                    // Check if killable
                    if (SmiteSpell.IsReady() && smiteable.TotalShieldHealth() <= SmiteDamage)
                    {
                        // Draw a bounding circle around the smiteable if killable
                        Circle.Draw(color, smiteable.BoundingRadius, width, smiteable);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private static void OnUpdate(EventArgs args)
 {
     // Check if summoner wants to smite
     if ((HoldKey.CurrentValue || ToggleKey.CurrentValue) && SmiteSpell.IsReady())
     {
         // Get first smiteable monster
         var smiteable =
             CurrentySmiteable.Where(o => Player.Instance.IsInRange(o, SmiteRange + Player.Instance.BoundingRadius + o.BoundingRadius)).OrderByDescending(o => o.MaxHealth).FirstOrDefault();
         if (smiteable != null)
         {
             // Check if that monster is enabled
             var name = smiteable.BaseSkinName.ToLower();
             if (EnabledMonsters.Any(enabled => name.Equals(enabled.Key.ToLower()) && enabled.Value.CurrentValue))
             {
                 // Check if monster can be killed
                 if (smiteable.TotalShieldHealth() <= SmiteDamage)
                 {
                     // Cast Smite
                     SmiteSpell.Cast(smiteable);
                 }
             }
         }
     }
 }