Advertisement
zjqyf

GLQ_PlayersCirclePlugin

Aug 2nd, 2017
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 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. public void PaintWorld(WorldLayer layer)
  27. {
  28. var players = Hud.Game.Players.Where(player => player.CoordinateKnown && (player.HeadStone == null));
  29. foreach (var player in players)
  30. {
  31. if (player.IsMe)
  32. {
  33. var MeGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 0, 3);
  34. MeDecorator = new WorldDecoratorCollection(
  35. new GroundCircleDecorator(Hud)
  36. {
  37. Brush = MeGroundBrush,
  38. Radius = player.RadiusBottom,
  39. }
  40. );
  41. MeDecorator.Paint(layer, null, player.FloorCoordinate, null);
  42. }
  43. else
  44. {
  45. switch (player.HeroClassDefinition.HeroClass)
  46. {
  47.  
  48. case HeroClass.Wizard:
  49. var WizardGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 255, 3);
  50. WizardDecorator = new WorldDecoratorCollection(
  51. new GroundCircleDecorator(Hud)
  52. {
  53. Brush = WizardGroundBrush,
  54. Radius = 3,
  55. }
  56. );
  57. WizardDecorator.Paint(layer, null, player.FloorCoordinate, null);
  58. break;
  59.  
  60. case HeroClass.WitchDoctor:
  61. var WitchDoctorGroundBrush = Hud.Render.CreateBrush(255, 0, 128, 64, 3);
  62. WitchDoctorDecorator = new WorldDecoratorCollection(
  63. new GroundCircleDecorator(Hud)
  64. {
  65. Brush = WitchDoctorGroundBrush,
  66. Radius = 3,
  67. }
  68. );
  69. WitchDoctorDecorator.Paint(layer, null, player.FloorCoordinate, null);
  70. break;
  71.  
  72. case HeroClass.Barbarian:
  73. var BarbarianGroundBrush = Hud.Render.CreateBrush(255, 255, 128, 64, 3);
  74. BarbarianDecorator = new WorldDecoratorCollection(
  75. new GroundCircleDecorator(Hud)
  76. {
  77. Brush = BarbarianGroundBrush,
  78. Radius = 3,
  79. }
  80. );
  81. BarbarianDecorator.Paint(layer, null, player.FloorCoordinate, null);
  82. break;
  83.  
  84. case HeroClass.DemonHunter:
  85. var DemonHunterGroundBrush = Hud.Render.CreateBrush(255, 36, 4, 187, 3);
  86. DemonHunterDecorator = new WorldDecoratorCollection(
  87. new GroundCircleDecorator(Hud)
  88. {
  89. Brush = DemonHunterGroundBrush,
  90. Radius = 3,
  91. }
  92. );
  93. DemonHunterDecorator.Paint(layer, null, player.FloorCoordinate, null);
  94. break;
  95.  
  96. case HeroClass.Crusader:
  97. var CrusaderGroundBrush = Hud.Render.CreateBrush(255, 240, 240, 240, 3);
  98. CrusaderDecorator = new WorldDecoratorCollection(
  99. new GroundCircleDecorator(Hud)
  100. {
  101. Brush = CrusaderGroundBrush,
  102. Radius = 3,
  103. }
  104. );
  105. CrusaderDecorator.Paint(layer, null, player.FloorCoordinate, null);
  106. break;
  107.  
  108. case HeroClass.Monk:
  109. var MonkGroundBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 3);
  110. MonkDecorator = new WorldDecoratorCollection(
  111. new GroundCircleDecorator(Hud)
  112. {
  113. Brush = MonkGroundBrush,
  114. Radius = 3,
  115. }
  116. );
  117. MonkDecorator.Paint(layer, null, player.FloorCoordinate, null);
  118. break;
  119. case HeroClass.Necromancer:
  120. var NecGroundBrush = Hud.Render.CreateBrush(255, 0, 128, 128, 3);
  121. NecDecorator = new WorldDecoratorCollection(
  122. new GroundCircleDecorator(Hud)
  123. {
  124. Brush = NecGroundBrush,
  125. Radius = player.RadiusBottom,
  126. }
  127. );
  128. NecDecorator.Paint(layer, null, player.FloorCoordinate, null);
  129. break;
  130.  
  131. }
  132. }
  133. }
  134. }
  135.  
  136. }
  137.  
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement