Advertisement
zjqyf

GLQ_AncientParthanCount.cs

Jul 31st, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. using System.Linq;
  2. using System;
  3. using Turbo.Plugins.Default;
  4.  
  5. namespace Turbo.Plugins.glq
  6. {
  7. using System.Text;
  8. public class GLQ_AncientParthanCount : BasePlugin, IInGameTopPainter
  9. {
  10. public IFont TextFont { get; set; }
  11. public float XWidth { get; set; }
  12. public float YHeight { get; set; }
  13. public int percent { get; set; }
  14. private StringBuilder textBuilder;
  15.  
  16. public GLQ_AncientParthanCount()
  17. {
  18. Enabled = true;
  19. }
  20.  
  21. public override void Load(IController hud)
  22. {
  23. base.Load(hud);
  24. TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 170, 90, 90, false, false, true);
  25. XWidth = 0.7f;
  26. YHeight = 0.4f;
  27. percent = 10;
  28. textBuilder = new StringBuilder();
  29. }
  30.  
  31. public void PaintTopInGame(ClipState clipState)
  32. {
  33. if (clipState != ClipState.BeforeClip) return;
  34. if (!Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.AncientParthanDefenders.Sno)) return;
  35. int Count = Hud.Game.AliveMonsters.Count(m => (m.Stunned || m.Frozen) && m.NormalizedXyDistanceToMe <= 25);
  36. if (Count == 0) return;
  37. double dr = 100 * ( 1 - Math.Pow(1 - percent * 0.01d, Count));
  38. float XPos = Hud.Window.Size.Width * XWidth;
  39. float YPos = Hud.Window.Size.Height * YHeight;
  40. if (Hud.Game.Me.CubeSnoItem2.LegendaryPower.Sno == Hud.Sno.SnoPowers.AncientParthanDefenders.Sno)
  41. {
  42. percent = 12;
  43. }
  44. textBuilder.Clear();
  45. textBuilder.AppendFormat("古帕触发数: {0} 特效值:{1}%", Count, percent);
  46. textBuilder.AppendLine();
  47. textBuilder.AppendFormat("古帕总减伤: {0}",dr.ToString("f2") + "%");
  48.  
  49. var layout = TextFont.GetTextLayout(textBuilder.ToString());
  50. TextFont.DrawText(layout, XPos, YPos);
  51. }
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement