Advertisement
zjqyf

PlayersCirclePlugin

Mar 13th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.glq
  5. {
  6. public class 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.  
  16. public PlayersCirclePlugin()
  17. {
  18. Enabled = true;
  19. }
  20.  
  21. public override void Load(IController hud)
  22. {
  23. base.Load(hud);
  24.  
  25. var MeGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 0, 3);
  26. MeDecorator = new WorldDecoratorCollection(
  27. new GroundCircleDecorator(Hud)
  28. {
  29. Brush = MeGroundBrush,
  30. Radius = 3,
  31. }
  32. );
  33.  
  34. var WizardGroundBrush = Hud.Render.CreateBrush(255, 255, 0, 255, 3);
  35. WizardDecorator = new WorldDecoratorCollection(
  36. new GroundCircleDecorator(Hud)
  37. {
  38. Brush = WizardGroundBrush,
  39. Radius = 3,
  40. }
  41. );
  42.  
  43. var WitchDoctorGroundBrush = Hud.Render.CreateBrush(255, 0, 128, 64, 3);
  44. WitchDoctorDecorator = new WorldDecoratorCollection(
  45. new GroundCircleDecorator(Hud)
  46. {
  47. Brush = WitchDoctorGroundBrush,
  48. Radius = 3,
  49. }
  50. );
  51.  
  52. var BarbarianGroundBrush = Hud.Render.CreateBrush(255, 128, 64, 64, 3);
  53. BarbarianDecorator = new WorldDecoratorCollection(
  54. new GroundCircleDecorator(Hud)
  55. {
  56. Brush = BarbarianGroundBrush,
  57. Radius = 3,
  58. }
  59. );
  60.  
  61. var DemonHunterGroundBrush = Hud.Render.CreateBrush(255, 36, 4, 187, 3);
  62. DemonHunterDecorator = new WorldDecoratorCollection(
  63. new GroundCircleDecorator(Hud)
  64. {
  65. Brush = DemonHunterGroundBrush,
  66. Radius = 3,
  67. }
  68. );
  69.  
  70. var CrusaderGroundBrush = Hud.Render.CreateBrush(255, 240, 240, 240, 3);
  71. CrusaderDecorator = new WorldDecoratorCollection(
  72. new GroundCircleDecorator(Hud)
  73. {
  74. Brush = CrusaderGroundBrush,
  75. Radius = 3,
  76. }
  77. );
  78.  
  79. var MonkGroundBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 3);
  80. MonkDecorator = new WorldDecoratorCollection(
  81. new GroundCircleDecorator(Hud)
  82. {
  83. Brush = MonkGroundBrush,
  84. Radius = 3,
  85. }
  86. );
  87. }
  88.  
  89. public void PaintWorld(WorldLayer layer)
  90. {
  91. var players = Hud.Game.Players.Where(player => player.CoordinateKnown && (player.HeadStone == null));
  92. foreach (var player in players)
  93. {
  94. if (player.IsMe) MeDecorator.Paint(layer, null, player.FloorCoordinate, null);
  95. if (!player.IsMe)
  96. {
  97. if((int)player.HeroClassDefinition.HeroClass == 0)DemonHunterDecorator.Paint(layer, null, player.FloorCoordinate, null);
  98. if((int)player.HeroClassDefinition.HeroClass == 1)BarbarianDecorator.Paint(layer, null, player.FloorCoordinate, null);
  99. if((int)player.HeroClassDefinition.HeroClass == 2)WizardDecorator.Paint(layer, null, player.FloorCoordinate, null);
  100. if((int)player.HeroClassDefinition.HeroClass == 3)WitchDoctorDecorator.Paint(layer, null, player.FloorCoordinate, null);
  101. if((int)player.HeroClassDefinition.HeroClass == 4)MonkDecorator.Paint(layer, null, player.FloorCoordinate, null);
  102. if((int)player.HeroClassDefinition.HeroClass == 5)CrusaderDecorator.Paint(layer, null, player.FloorCoordinate, null);
  103. }
  104. }
  105. }
  106.  
  107. }
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement