Code:
// TriunesWillPlugin
// Ground Decorators & Timers for Triune's Will circles from Season 18 buff.
// Additional Marker when you are in a circle (Thanks to JarJar & RNN !).
using System.Linq;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.Extended.Actors
{
public class TriunesWillPlugin : BasePlugin, IInGameWorldPainter
{
public WorldDecoratorCollection LoveDecorator { get; set; }
public WorldDecoratorCollection DeterminationDecorator { get; set; }
public WorldDecoratorCollection CreationDecorator { get; set; }
public WorldDecoratorCollection LoveInsideDecorator { get; set; }
public WorldDecoratorCollection DeterminationInsideDecorator { get; set; }
public WorldDecoratorCollection CreationInsideDecorator { get; set; }
public float CircleRadius { get; set; }
public float InsideRadius { get; set; }
public bool EnableLove { get; set; }
public bool EnableDetermination { get; set; }
public bool EnableCreation { get; set; }
public bool EnableInsideMarker { get; set; }
public IFont DescriptionText1 { get; set; }
public IFont DescriptionText2 { get; set; }
public bool EnableDescription { get; set; }
public TriunesWillPlugin()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
EnableLove = true; // Damage Circle
EnableCreation = true; // CDR Circle
EnableDetermination = true; // RCR Circle
EnableInsideMarker = true; // Additional Circle Decorator when you are in it
EnableDescription = true;
CircleRadius = 10.0f; // Change the radius of the circle decorator
InsideRadius = 10.0f; // Change the radius of the additional "inside marker"
DescriptionText1 = Hud.Render.CreateFont("tahoma", 9f, 255,255,255,255, false, false, 128, 0, 0, 0, true) ;
DescriptionText2 = Hud.Render.CreateFont("tahoma", 5f, 255,255,255,255, false, false, 128, 0, 0, 0, true) ;
LoveInsideDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 150, 0, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // 220, 0, 64
Radius = InsideRadius,
}
);
CreationInsideDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 0, 80, 150, -2, SharpDX.Direct2D1.DashStyle.Dash),
Radius = InsideRadius,
}
);
DeterminationInsideDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 120, 80, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // Dark Blue 0, 64, 255 - Gold 164, 100, 32
Radius = InsideRadius,
}
);
LoveDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -2),
Radius = CircleRadius,
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 7,
TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 255, 96, 255, 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(164, 192, 0, 0, 0),
Radius = 30,
},
new MapShapeDecorator(Hud)
{
ShapePainter = new CircleShapePainter(Hud),
Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -1f),
ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
Radius = CircleRadius - 2,
}
);
CreationDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -2),
Radius = CircleRadius,
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 7,
TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 230, 196, 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(164, 0, 192, 192, 0),
Radius = 30,
},
new MapShapeDecorator(Hud)
{
ShapePainter = new CircleShapePainter(Hud),
Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -1f),
ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
Radius = CircleRadius - 2,
}
);
DeterminationDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 164, 164, 32, -2), // Dark Blue 0, 64, 255
Radius = CircleRadius,
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 7,
TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 200, 200, 96, true, false, 128, 0, 0, 0, true), // Dark Blue 96, 96, 255
},
new GroundTimerDecorator(Hud)
{
CountDownFrom = 7,
BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
BackgroundBrushFill = Hud.Render.CreateBrush(164, 164, 164, 0, 0), // Dark Blue 0, 0, 192
Radius = 30,
},
new MapShapeDecorator(Hud)
{
ShapePainter = new CircleShapePainter(Hud),
Brush = Hud.Render.CreateBrush(255, 164, 164, 32, -1f),
ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
Radius = CircleRadius - 2,
}
);
}
public void PaintWorld(WorldLayer layer)
{
if (Hud.Game.IsInTown) return;
bool Inside = false;
float CoordX, CoordY;
if (EnableLove) {
var love = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 2)) { Inside = true; }
foreach (var actor in love)
{
LoveDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
if (EnableDescription)
{
DescriptionText1.DrawText(DescriptionText1.GetTextLayout("DMG"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
DescriptionText2.DrawText(DescriptionText2.GetTextLayout("DMG"),CoordX - 8 , CoordY + 7);
}
if (Inside) { LoveInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
}
}
if (EnableCreation) {
var creation = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_7_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 8)) { Inside = true; }
foreach (var actor in creation)
{
CreationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
if (EnableDescription)
{
DescriptionText1.DrawText(DescriptionText1.GetTextLayout("CDR"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
DescriptionText2.DrawText(DescriptionText2.GetTextLayout("CDR"),CoordX - 8 , CoordY + 7 );
}
if (Inside) { CreationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
}
}
if (EnableDetermination) {
var determination = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_6_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 5)) { Inside = true; }
foreach (var actor in determination)
{
DeterminationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
if (EnableDescription)
{
DescriptionText1.DrawText(DescriptionText1.GetTextLayout("RSR"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
DescriptionText2.DrawText(DescriptionText2.GetTextLayout("RSR"),CoordX - 8 , CoordY + 7 );
}
if (Inside) { DeterminationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
}
}
}
}
}