Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. using System.Globalization;
  2. using Turbo.Plugins.Default;
  3. using System.Linq;
  4. using SharpDX.DirectInput;
  5.  
  6. using System;
  7. using System.Text;
  8. using System.Collections.Generic;
  9.  
  10. namespace Turbo.Plugins.Frank
  11. {
  12. using System.Text;
  13.  
  14.  
  15. public class SeasonBar : BasePlugin, IInGameTopPainter
  16. {
  17. private readonly int[] _skillOrder = { 2, 3, 4, 5, 0, 1 };
  18. private StringBuilder textBuilder;
  19. private StringBuilder buffBuilder;
  20. private IFont GreenFont;
  21. private IFont RedFont;
  22. public double ArchonTimeLeft;
  23. public double Cooldown;
  24. public bool WizIngame;
  25. public double ArchonLeft;
  26. public IBrush BackgroundBrush { get; set; }
  27. public IBrush KillCountBrush { get; set; }
  28. public IBrush KillCountWarningBrush { get; set; }
  29. public IBrush TimerOutsideBrush { get; set; }
  30. public IBrush BorderBrush { get; set; }
  31. public IBrush BuffBrush { get; set; }
  32. public const float BorderSize = 1.2f;
  33. public SeasonBar()
  34. {
  35. Enabled = true;
  36. }
  37.  
  38. public override void Load(IController hud)
  39. {
  40. base.Load(hud);
  41. GreenFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, false);
  42. RedFont = Hud.Render.CreateFont("tahoma", 8, 255, 58, 227, 239, true, false, false);
  43. textBuilder = new StringBuilder();
  44. buffBuilder = new StringBuilder();
  45. BackgroundBrush = Hud.Render.CreateBrush(240, 0, 0, 0, 0);
  46. KillCountBrush = Hud.Render.CreateBrush(240, 12, 175, 17, 0);
  47. KillCountWarningBrush = Hud.Render.CreateBrush(240, 246, 57, 57, 0);
  48. TimerOutsideBrush = Hud.Render.CreateBrush(240, 100, 100, 100, 0);
  49. BorderBrush = Hud.Render.CreateBrush(240, 244, 169, 80, 0);
  50. BuffBrush = Hud.Render.CreateBrush(240, 212, 245, 244, 0);
  51. }
  52.  
  53.  
  54. public void PaintTopInGame(ClipState clipState)
  55. {
  56. if (Hud.Render.UiHidden) return;
  57. if (Hud.Game.SpecialArea != SpecialArea.GreaterRift) return;
  58.  
  59. float x = Hud.Window.Size.Width - (Hud.Window.Size.Width * 0.173f);
  60. float y = Hud.Window.Size.Height * 0.48f;
  61. float sizex = Hud.Window.Size.Width * 0.16f;
  62. float sizey = Hud.Window.Size.Height * 0.02f;
  63. float textx = Hud.Window.Size.Width - (Hud.Window.Size.Width * 0.10f);
  64. float texty = Hud.Window.Size.Height * 0.481f;
  65. textBuilder.Clear();
  66. buffBuilder.Clear();
  67. float nextBuffX = 0;
  68. int killCount = 0;
  69.  
  70. var percent = Hud.Game.RiftPercentage;
  71. if (Hud.Game.Me.Powers.BuffIsActive(483967)) // Jugando en temporada
  72. {
  73. killCount = Hud.Game.Me.Powers.GetBuff(483967).IconCounts[1];
  74. }
  75.  
  76. float angelsProgress = (float)(killCount / 500.0);
  77.  
  78. if(angelsProgress > 1) {
  79. angelsProgress = 1;
  80. }
  81.  
  82. //var ATleft = (ArchonLeft - Hud.Game.CurrentGameTick) / 60.0d;
  83. textBuilder.AppendFormat("{0:0}", killCount);
  84.  
  85.  
  86.  
  87. BackgroundBrush.DrawRectangle(x, y, sizex, sizey);
  88.  
  89.  
  90. if(killCount > 400){
  91. buffBuilder.Append("Angels");
  92. nextBuffX = sizex;
  93. } else if(killCount > 300) {
  94. nextBuffX = sizex * (float)( 400.0 / 500.0);
  95. buffBuilder.Append("Meteors");
  96. } else if(killCount > 200) {
  97. nextBuffX = sizex * (float)( 350.0 / 500.0);
  98. buffBuilder.Append("Fire Ring");
  99. } else if(killCount > 150) {
  100. nextBuffX = sizex * (float)( 200.0 / 500.0);
  101. buffBuilder.Append("Chests");
  102. } else if(killCount > 100) {
  103. nextBuffX = sizex * (float)( 150.0 / 500.0);
  104. buffBuilder.Append("Geysers");
  105. } else if(killCount < 100) {
  106. nextBuffX = sizex * (float)( 100.0 / 500.0);
  107. buffBuilder.Append("Tornados");
  108. }
  109.  
  110.  
  111. BuffBrush.DrawRectangle(x, y, nextBuffX, sizey);
  112.  
  113. if (killCount > 0)
  114. {
  115. if((angelsProgress * 100) < percent) {
  116. KillCountBrush.DrawRectangle(x, y, sizex * angelsProgress, sizey);
  117. } else {
  118. KillCountWarningBrush.DrawRectangle(x, y, sizex * angelsProgress, sizey);
  119. }
  120. }
  121.  
  122. BorderBrush.DrawLine(x, y, x + sizex, y, 0.6f);
  123. BorderBrush.DrawLine(x + sizex, y, x + sizex, y + sizey, BorderSize);
  124. BorderBrush.DrawLine(x, y + sizey, x + sizex, y + sizey, BorderSize);
  125. BorderBrush.DrawLine(x, y, x, y + sizey, 0.6f);
  126.  
  127. var layout = GreenFont.GetTextLayout(textBuilder.ToString());
  128. var nextBuff = RedFont.GetTextLayout(buffBuilder.ToString());
  129. GreenFont.DrawText(layout, textx, texty);
  130. RedFont.DrawText(nextBuff, textx, texty + sizey);
  131.  
  132. }
  133. }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement