Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.glq
- {
- using System.Text;
- // by 我想静静 黑白灰 Modifier zjqyf1111
- public class MonstersCountPlugin : BasePlugin, IInGameTopPainter
- {
- public IFont TextFont { get; set; }
- public int Yard { get; set; }
- public bool ShowTotalProgression { get; set; }
- public bool ShowLlocustCount { get; set; }
- public bool ShowHauntedCount { get; set; }
- public bool ShowPalmedCount { get; set; }
- public bool ShowPhoenixedCount { get; set; }
- public bool ShowStrongarmedCount { get; set; }
- private StringBuilder textBuilder;
- public MonstersCountPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 180, 147, 109, false, false, true);
- Yard = 40;
- ShowTotalProgression = true;
- ShowLlocustCount = true;
- ShowHauntedCount = true;
- ShowPalmedCount = true;
- ShowPhoenixedCount = false;
- ShowStrongarmedCount = true;
- textBuilder = new StringBuilder();
- }
- public void PaintTopInGame(ClipState clipState)
- {
- var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
- if (TextFont == null)
- {
- return;
- }
- double totalMonsterRiftProgression = 0;
- int monstersCount = 0;
- // locust
- int locustCount = 0;
- // haunted
- int hauntedCount = 0;
- //Palmed
- int palmedCount = 0;
- //Phoenixed BUG? http://turbohud.freeforums.net/thread/3945/monster-phoenixed
- int phoenixedCount = 0;
- //Strongarmed
- int strongarmedCount = 0;
- var monsters = Hud.Game.AliveMonsters.Where(m => m.SummonerAcdDynamicId == 0 && m.IsElite || !m.IsElite);
- foreach (var monster in monsters)
- {
- if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) > Yard) continue;
- if (inRift && ShowTotalProgression) totalMonsterRiftProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
- monstersCount++;
- if (monster.Locust && ShowLlocustCount)
- {
- locustCount++;
- }
- if (monster.Haunted && ShowHauntedCount)
- {
- hauntedCount++;
- }
- if (monster.Palmed && ShowPalmedCount)
- {
- palmedCount++;
- }
- if (monster.Phoenixed && ShowPhoenixedCount)
- {
- phoenixedCount++;
- }
- if (monster.Strongarmed && ShowStrongarmedCount)
- {
- strongarmedCount++;
- }
- }
- if (monstersCount == 0)
- {
- return;
- }
- textBuilder.Clear();
- textBuilder.AppendFormat("{0} yard Monster Count: {1}", Yard, monstersCount);
- textBuilder.AppendLine();
- textBuilder.AppendLine();
- if (inRift && ShowTotalProgression)
- {
- textBuilder.AppendFormat("Total progress:{0}%", totalMonsterRiftProgression.ToString("f2"));
- textBuilder.AppendLine();
- }
- if (locustCount > 0)
- {
- textBuilder.AppendFormat("Locust: {0}", locustCount);
- textBuilder.AppendLine();
- }
- if (hauntedCount > 0)
- {
- textBuilder.AppendFormat("Haunted: {0}", hauntedCount);
- textBuilder.AppendLine();
- }
- if (palmedCount > 0)
- {
- textBuilder.AppendFormat("Palmed: {0}", palmedCount);
- textBuilder.AppendLine();
- }
- if (phoenixedCount > 0)
- {
- textBuilder.AppendFormat("Phoenixed: {0}", phoenixedCount);
- textBuilder.AppendLine();
- }
- if (strongarmedCount > 0)
- {
- textBuilder.AppendFormat("Strongarmed: {0}", strongarmedCount);
- textBuilder.AppendLine();
- }
- var layout = TextFont.GetTextLayout(textBuilder.ToString());
- TextFont.DrawText(layout, Hud.Window.Size.Width - Hud.Window.Size.Width * 0.16f, Hud.Window.Size.Height / 2 + Hud.Window.Size.Height * 0.1f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement