Advertisement
Guest User

WormholePlugin

a guest
Jun 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.BM
  5. {
  6.     public class WormholePlugin : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public WorldDecoratorCollection WormholeDecorator { get; set; }
  9.         public WormholePlugin()
  10.         {
  11.             Enabled = true;
  12.         }
  13.         public override void Load(IController hud)
  14.         {
  15.             base.Load(hud);
  16.             WormholeDecorator = new WorldDecoratorCollection(
  17.                 new GroundCircleDecorator(Hud)
  18.                 {
  19.                     Brush = Hud.Render.CreateBrush(255, 102, 0, 204, -2),
  20.                     Radius = 6f,
  21.                 },
  22.                 new GroundShapeDecorator(hud)
  23.                 {
  24.                     ShapePainter = WorldStarShapePainter.NewCross(Hud),
  25.                     Radius = 6f,
  26.                     Brush = Hud.Render.CreateBrush(255, 102, 0, 204, 20),
  27.                 },
  28.                 new GroundLabelDecorator(Hud)
  29.                 {
  30.                     CountDownFrom = 6,
  31.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 255, 96, true, false, 128, 0, 0, 0, true),
  32.                 },
  33.                 new GroundTimerDecorator(Hud)
  34.                 {
  35.                     CountDownFrom = 6,
  36.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  37.                     BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 192, 0, 0),
  38.                     Radius = 30,
  39.                 }
  40.             );
  41.         }
  42.  
  43.         public void PaintWorld(WorldLayer layer)
  44.         {
  45.             if (Hud.Game.IsInTown)
  46.                 return;
  47.  
  48.             var wormhole = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_monsteraffix_teleportmines); // 337109
  49.             foreach (var actor in wormhole)
  50.             {
  51.                 WormholeDecorator.Paint(layer, actor, actor.FloorCoordinate, string.Empty);
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement