using System.Linq; using Turbo.Plugins.Default; namespace Turbo.Plugins.glq { public class Oculus2Plugin : BasePlugin, IInGameWorldPainter { public WorldDecoratorCollection OculusDecorator { get; set; } public WorldDecoratorCollection NonOculusDecorator { get; set; } public Oculus2Plugin() { Enabled = true; } public override void Load(IController hud) { base.Load(hud); OculusDecorator = new WorldDecoratorCollection( new GroundCircleDecorator(Hud) { Brush = Hud.Render.CreateBrush(255, 0, 0, 255, -2), Radius = 10.0f, }, new GroundLabelDecorator(Hud) { CountDownFrom = 7, TextFont = Hud.Render.CreateFont("tahoma", 20, 255, 0, 0, 192, true, false, 128, 0, 0, 0, true), }, new GroundTimerDecorator(Hud) { CountDownFrom = 7, BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0), BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 0, 192, 0), Radius = 30, } ); NonOculusDecorator = new WorldDecoratorCollection( new GroundCircleDecorator(Hud) { Brush = Hud.Render.CreateBrush(255, 128, 255, 0, -2), Radius = 10.0f, }, new GroundLabelDecorator(Hud) { CountDownFrom = 7, TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 255, 96, true, false, 128, 0, 0, 0, true), }, new GroundTimerDecorator(Hud) { CountDownFrom = 7, BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0), BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 192, 0, 0), Radius = 30, } ); } public void PaintWorld(WorldLayer layer) { if (Hud.Game.IsInTown) return; var actors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, Hud.Sno.SnoPowers.OculusRing.Sno) == 1); foreach (var actor in actors) { if (Hud.Game.Me.Powers.BuffIsActive(402461, 2)) { OculusDecorator.Paint(layer, actor, actor.FloorCoordinate, null); } else NonOculusDecorator.Paint(layer, actor, actor.FloorCoordinate, null); } } } }