Advertisement
VitaKaninen

GuardianSentry.cs

Mar 11th, 2023 (edited)
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.37 KB | Gaming | 0 0
  1. using Turbo.Plugins.Default;
  2. using System.Collections.Generic;
  3. namespace Turbo.Plugins.User
  4. {
  5.     public class PlayerSkillPlugin : BasePlugin, IInGameWorldPainter
  6.     {
  7.         public WorldDecoratorCollection SentryDecorator { get; set; }
  8.         public WorldDecoratorCollection SentryWithCustomEngineeringDecorator { get; set; }
  9.         public PlayerSkillPlugin()
  10.         {
  11.             Enabled = true;
  12.         }
  13.  
  14.         public override void Load(IController hud)
  15.         {
  16.             base.Load(hud);
  17.  
  18.             SentryDecorator = new WorldDecoratorCollection(
  19.                 new GroundCircleDecorator(Hud)
  20.                 {
  21.                     Brush = Hud.Render.CreateBrush(100, 0, 255, 0, 4),
  22.                     Radius = 16,
  23.                 },
  24.                 new MapShapeDecorator(Hud)
  25.                 {
  26.                     Brush = Hud.Render.CreateBrush(255, 64, 255, 64, 1),
  27.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  28.                     Radius = 16.0f,
  29.                     ShapePainter = new CircleShapePainter(Hud),
  30.                 },
  31.                 new MapShapeDecorator(Hud)
  32.                 {
  33.                     Brush = Hud.Render.CreateBrush(255, 240, 148, 32, 2),
  34.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  35.                     ShapePainter = new TriangleShapePainter(Hud),
  36.                     Radius = 4f,
  37.                 },
  38.                 new GroundLabelDecorator(Hud)
  39.                 {
  40.                     CountDownFrom = 30,
  41.                     TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 240, 148, 32, true, false, 128, 0, 0, 0, true),
  42.                 },
  43.                 new GroundTimerDecorator(Hud)
  44.                 {
  45.                     CountDownFrom = 30,
  46.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  47.                     BackgroundBrushFill = Hud.Render.CreateBrush(160, 240, 148, 32, 0),
  48.                     Radius = 30,
  49.                 }
  50.                 );
  51.                
  52.            SentryWithCustomEngineeringDecorator = new WorldDecoratorCollection(
  53.                 new GroundCircleDecorator(Hud)
  54.                 {
  55.                     Brush = Hud.Render.CreateBrush(100, 0, 255, 0, 4),
  56.                     Radius = 16,
  57.                 },
  58.                 new MapShapeDecorator(Hud)
  59.                 {
  60.                     Brush = Hud.Render.CreateBrush(255, 64, 255, 64, 1),
  61.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  62.                     Radius = 16.0f,
  63.                     ShapePainter = new CircleShapePainter(Hud),
  64.                 },
  65.                 new MapShapeDecorator(Hud)
  66.                 {
  67.                     Brush = Hud.Render.CreateBrush(255, 240, 148, 32, 2),
  68.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  69.                     ShapePainter = new TriangleShapePainter(Hud),
  70.                     Radius = 4f,
  71.                 },
  72.                 new GroundLabelDecorator(Hud)
  73.                 {
  74.                     CountDownFrom = 60,
  75.                     TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 240, 148, 32, true, false, 128, 0, 0, 0, true),
  76.                 },
  77.                 new GroundTimerDecorator(Hud)
  78.                 {
  79.                     CountDownFrom = 60,
  80.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  81.                     BackgroundBrushFill = Hud.Render.CreateBrush(160, 240, 148, 32, 0),
  82.                     Radius = 30,
  83.                 }
  84.                 );
  85.         }
  86.  
  87.         public void PaintWorld(WorldLayer layer)
  88.         {
  89.             var actors = Hud.Game.Actors;
  90.             foreach (var actor in actors)
  91.             {
  92.  
  93.                     switch (actor.SnoActor.Sno)
  94.                     {
  95.  
  96.  
  97.                         case ActorSnoEnum._dh_sentry_addsshield:
  98.                             if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))
  99.                             {
  100.                                 SentryDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  101.                             }
  102.                            
  103.                             else
  104.                             {
  105.                                 SentryWithCustomEngineeringDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  106.                             }
  107.                            
  108.                             break;
  109.                     }
  110.                
  111.             }
  112.         }
  113.     }
  114. }
Tags: turbohud
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement