Advertisement
zjqyf

GLQ_PlayersCirclePlugin

Jul 23rd, 2017
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.glq
  5. {
  6. public class GLQ_PlayersCirclePlugin : BasePlugin, IInGameWorldPainter
  7. {
  8. public WorldDecoratorCollection MeDecorator { get; set; }
  9. public WorldDecoratorCollection WizardDecorator { get; set; }
  10. public WorldDecoratorCollection WitchDoctorDecorator { get; set; }
  11. public WorldDecoratorCollection BarbarianDecorator { get; set; }
  12. public WorldDecoratorCollection DemonHunterDecorator { get; set; }
  13. public WorldDecoratorCollection CrusaderDecorator { get; set; }
  14. public WorldDecoratorCollection MonkDecorator { get; set; }
  15. public WorldDecoratorCollection NecDecorator { get; set; }
  16.  
  17. public GLQ_PlayersCirclePlugin()
  18. {
  19. Enabled = true;
  20. }
  21.  
  22. public override void Load(IController hud)
  23. {
  24. base.Load(hud);
  25.  
  26. var MeGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 0, 3);
  27. MeDecorator = new WorldDecoratorCollection(
  28. new GroundCircleDecorator(Hud)
  29. {
  30. Brush = MeGroundBrush,
  31. Radius = 3,
  32. }
  33. );
  34.  
  35. var WizardGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 255, 3);
  36. WizardDecorator = new WorldDecoratorCollection(
  37. new GroundCircleDecorator(Hud)
  38. {
  39. Brush = WizardGroundBrush,
  40. Radius = 3,
  41. }
  42. );
  43.  
  44. var WitchDoctorGroundBrush = Hud.Render.CreateBrush(255, 0, 128, 64, 3);
  45. WitchDoctorDecorator = new WorldDecoratorCollection(
  46. new GroundCircleDecorator(Hud)
  47. {
  48. Brush = WitchDoctorGroundBrush,
  49. Radius = 3,
  50. }
  51. );
  52.  
  53. var BarbarianGroundBrush = Hud.Render.CreateBrush(255, 128, 64, 64, 3);
  54. BarbarianDecorator = new WorldDecoratorCollection(
  55. new GroundCircleDecorator(Hud)
  56. {
  57. Brush = BarbarianGroundBrush,
  58. Radius = 3,
  59. }
  60. );
  61.  
  62. var DemonHunterGroundBrush = Hud.Render.CreateBrush(255, 36, 4, 187, 3);
  63. DemonHunterDecorator = new WorldDecoratorCollection(
  64. new GroundCircleDecorator(Hud)
  65. {
  66. Brush = DemonHunterGroundBrush,
  67. Radius = 3,
  68. }
  69. );
  70.  
  71. var CrusaderGroundBrush = Hud.Render.CreateBrush(255, 240, 240, 240, 3);
  72. CrusaderDecorator = new WorldDecoratorCollection(
  73. new GroundCircleDecorator(Hud)
  74. {
  75. Brush = CrusaderGroundBrush,
  76. Radius = 3,
  77. }
  78. );
  79.  
  80. var MonkGroundBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 3);
  81. MonkDecorator = new WorldDecoratorCollection(
  82. new GroundCircleDecorator(Hud)
  83. {
  84. Brush = MonkGroundBrush,
  85. Radius = 3,
  86. }
  87. );
  88.  
  89. var NecGroundBrush = Hud.Render.CreateBrush(255, 175, 238, 238, 3);
  90. NecDecorator = new WorldDecoratorCollection(
  91. new GroundCircleDecorator(Hud)
  92. {
  93. Brush = NecGroundBrush,
  94. Radius = 3,
  95. }
  96. );
  97. }
  98.  
  99. public void PaintWorld(WorldLayer layer)
  100. {
  101. var players = Hud.Game.Players.Where(player => player.CoordinateKnown && (player.HeadStone == null));
  102. foreach (var player in players)
  103. {
  104. if (player.IsMe)
  105. MeDecorator.Paint(layer, null, player.FloorCoordinate, null);
  106. else
  107. {
  108. switch (player.HeroClassDefinition.HeroClass)
  109. {
  110. case HeroClass.Wizard:
  111. WizardDecorator.Paint(layer, null, player.FloorCoordinate, null);
  112. break;
  113.  
  114. case HeroClass.WitchDoctor:
  115. WitchDoctorDecorator.Paint(layer, null, player.FloorCoordinate, null);
  116. break;
  117.  
  118. case HeroClass.Barbarian:
  119. BarbarianDecorator.Paint(layer, null, player.FloorCoordinate, null);
  120. break;
  121.  
  122. case HeroClass.DemonHunter:
  123. DemonHunterDecorator.Paint(layer, null, player.FloorCoordinate, null);
  124. break;
  125.  
  126. case HeroClass.Crusader:
  127. CrusaderDecorator.Paint(layer, null, player.FloorCoordinate, null);
  128. break;
  129.  
  130. case HeroClass.Monk:
  131. MonkDecorator.Paint(layer, null, player.FloorCoordinate, null);
  132. break;
  133. case HeroClass.Necromancer:
  134. NecDecorator.Paint(layer, null, player.FloorCoordinate, null);
  135. break;
  136.  
  137. }
  138. }
  139. }
  140. }
  141.  
  142. }
  143.  
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement