AndyYin

TriuneWillBuffPlugin

Aug 23rd, 2019
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.58 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.yin
  5. {
  6.     public class TriuneWillBuffPlugin : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public WorldDecoratorCollection BlueDecorator { get; set; }
  9.         public WorldDecoratorCollection TealDecorator { get; set; }
  10.         public WorldDecoratorCollection PurpleDecorator { get; set; }
  11.  
  12.         public TriuneWillBuffPlugin()
  13.         {
  14.             Enabled = true;
  15.         }
  16.  
  17.         public override void Load(IController hud)
  18.         {
  19.             base.Load(hud);
  20.  
  21.             BlueDecorator = new WorldDecoratorCollection(
  22.                 new GroundCircleDecorator(Hud)
  23.                 {
  24.                     Brush = Hud.Render.CreateBrush(255, 0, 254, 255, -2),
  25.                     Radius = 10.0f,
  26.                 },
  27.                 new GroundLabelDecorator(Hud)
  28.                 {
  29.                     CountDownFrom = 7,
  30.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 0, 254, 255, true, false, 128, 0, 0, 0, true),
  31.                 },
  32.                 new GroundTimerDecorator(Hud)
  33.                 {
  34.                     CountDownFrom = 7,
  35.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  36.                     BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 254, 255, 0),
  37.                     Radius = 30,
  38.                 }
  39.                 );
  40.  
  41.             TealDecorator = new WorldDecoratorCollection(
  42.                 new GroundCircleDecorator(Hud)
  43.                 {
  44.                     Brush = Hud.Render.CreateBrush(255, 204, 255, 51, -2),
  45.                     Radius = 10.0f,
  46.                 },
  47.                 new GroundLabelDecorator(Hud)
  48.                 {
  49.                     CountDownFrom = 7,
  50.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 204, 255, 51, true, false, 128, 0, 0, 0, true),
  51.                 },
  52.                 new GroundTimerDecorator(Hud)
  53.                 {
  54.                     CountDownFrom = 7,
  55.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  56.                     BackgroundBrushFill = Hud.Render.CreateBrush(200, 204, 255, 51, 0),
  57.                     Radius = 30,
  58.                 }
  59.                 );
  60.  
  61.             PurpleDecorator = new WorldDecoratorCollection(
  62.                 new GroundCircleDecorator(Hud)
  63.                 {
  64.                     Brush = Hud.Render.CreateBrush(255, 255, 102, 204, -2),
  65.                     Radius = 10.0f,
  66.                 },
  67.                 new GroundLabelDecorator(Hud)
  68.                 {
  69.                     CountDownFrom = 7,
  70.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 255, 102, 204, true, false, 128, 0, 0, 0, true),
  71.                 },
  72.                 new GroundTimerDecorator(Hud)
  73.                 {
  74.                     CountDownFrom = 7,
  75.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  76.                     BackgroundBrushFill = Hud.Render.CreateBrush(200, 255, 102, 204, 0),
  77.                     Radius = 30,
  78.                 }
  79.                 );
  80.         }
  81.  
  82.         public void PaintWorld(WorldLayer layer)
  83.         {
  84.             if (Hud.Game.IsInTown) return;
  85.  
  86.             if (PurpleDecorator != null){
  87.                 var PurpleActors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy &&
  88.                     x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, 483606) == 1);
  89.                 foreach (var actor in PurpleActors)
  90.                 {
  91.                     PurpleDecorator.Paint(layer, actor, actor.FloorCoordinate, string.Empty);
  92.                 }
  93.             }
  94.  
  95.             if (TealDecorator != null)
  96.             {
  97.                 var TealActors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy &&
  98.                     x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_6_Visual_Effect_None, 483606) == 1);
  99.                 foreach (var actor in TealActors)
  100.                 {
  101.                     TealDecorator.Paint(layer, actor, actor.FloorCoordinate, string.Empty);
  102.                 }
  103.             }
  104.  
  105.             if (BlueDecorator != null){
  106.                 var BlueActors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy &&
  107.                     x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_7_Visual_Effect_None, 483606) == 1);
  108.                 foreach (var actor in BlueActors)
  109.                 {
  110.                     BlueDecorator.Paint(layer, actor, actor.FloorCoordinate, string.Empty);
  111.                 }
  112.             }
  113.         }
  114.     }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment