Advertisement
Guest User

DemonForgePlugin

a guest
Feb 14th, 2019
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.02 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3. using System.Collections.Generic;
  4.  
  5. namespace Turbo.Plugins.BM
  6. {
  7.     public class DemonForgePlugin : BasePlugin, IInGameWorldPainter
  8.     {
  9.         public WorldDecoratorCollection DemonForgeDecorator { get; set; }
  10.        
  11.         private HashSet<uint> demonicForgesIds = new HashSet<uint>() { 174900, 185391 };
  12.        
  13.         public DemonForgePlugin()
  14.         {
  15.             Enabled = true;
  16.         }
  17.         public override void Load(IController hud)
  18.         {
  19.             base.Load(hud);          
  20.             DemonForgeDecorator = new WorldDecoratorCollection(
  21.                 new MapShapeDecorator(Hud)
  22.                 {
  23.                     Brush = Hud.Render.CreateBrush(255, 255, 255, 220, 0),
  24.                     Radius = 6.0f,
  25.                     ShapePainter = new CircleShapePainter(Hud),
  26.                     RadiusTransformator = new StandardPingRadiusTransformator(Hud, 333),
  27.                 },
  28.                 new MapLabelDecorator(Hud)
  29.                 {
  30.                     LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 255, 0, 0, true, false, false),
  31.                 },
  32.                 new GroundCircleDecorator(Hud)
  33.                 {
  34.                     Brush = Hud.Render.CreateBrush(255, 255, 255, 220, 5, SharpDX.Direct2D1.DashStyle.Dash),
  35.                     Radius = 45,
  36.                 },
  37.                 new GroundLabelDecorator(Hud)
  38.                 {
  39.                     BackgroundBrush = Hud.Render.CreateBrush(160, 255, 255, 220, 0),
  40.                     TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 255, 0, 0, true, false, false),                    
  41.                 }
  42.                 );
  43.         }
  44.  
  45.         public void PaintWorld(WorldLayer layer)
  46.         {
  47.             var shocktower = Hud.Game.Actors.Where(x => demonicForgesIds.Contains((uint)x.SnoActor.Sno));
  48.             foreach (var actor in shocktower)
  49.             {
  50.                 DemonForgeDecorator.Paint(layer, actor, actor.FloorCoordinate, "!!! " + actor.SnoActor.NameLocalized + " !!!");
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement