Advertisement
zjqyf

MonsterHauntedandLocustPlugin

Mar 12th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2.  
  3. namespace Turbo.Plugins.glq
  4. {
  5. public class MonsterHauntedandLocustPlugin : BasePlugin, IInGameWorldPainter
  6. {
  7.  
  8. public WorldDecoratorCollection LocustDecorator { get; set; }
  9. public WorldDecoratorCollection HauntedDecorator { get; set; }
  10. public bool ShowLocust { get; set; }
  11. public bool ShowHaunted { get; set; }
  12.  
  13. public MonsterHauntedandLocustPlugin()
  14. {
  15. Enabled = true;
  16. ShowLocust = true;
  17. ShowHaunted = true;
  18. }
  19.  
  20. public override void Load(IController hud)
  21. {
  22. base.Load(hud);
  23.  
  24. var LocustGroundBrush = Hud.Render.CreateBrush(255, 0, 255, 128, 3, SharpDX.Direct2D1.DashStyle.Solid);
  25. LocustDecorator = new WorldDecoratorCollection(
  26. new GroundCircleDecorator(Hud)
  27. {
  28. Brush = LocustGroundBrush,
  29. Radius = 0.6f,
  30. }
  31. );
  32.  
  33. var HauntedGroundBrush = Hud.Render.CreateBrush(255, 0, 128, 255, 0, SharpDX.Direct2D1.DashStyle.Solid);
  34. HauntedDecorator = new WorldDecoratorCollection(
  35. new GroundCircleDecorator(Hud)
  36. {
  37. Brush = HauntedGroundBrush,
  38. Radius = 0.5f,
  39. }
  40. );
  41.  
  42. }
  43.  
  44. public void PaintWorld(WorldLayer layer)
  45. {
  46. var monsters = Hud.Game.AliveMonsters;
  47. foreach (var monster in monsters)
  48. {
  49.  
  50. if (monster.Locust && ShowLocust)
  51. {
  52. LocustDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  53. }
  54. if (monster.Haunted && ShowHaunted)
  55. {
  56. HauntedDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  57. }
  58. }
  59. }
  60.  
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement