Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- using System.Collections.Generic;
- namespace Turbo.Plugins.User
- {
- public class PlayerSkillPlugin : BasePlugin, IInGameWorldPainter
- {
- public WorldDecoratorCollection SentryDecorator { get; set; }
- public WorldDecoratorCollection SentryWithCustomEngineeringDecorator { get; set; }
- public PlayerSkillPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- SentryDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(100, 0, 255, 0, 4),
- Radius = 16,
- },
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 64, 255, 64, 1),
- ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
- Radius = 16.0f,
- ShapePainter = new CircleShapePainter(Hud),
- },
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 240, 148, 32, 2),
- ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
- ShapePainter = new TriangleShapePainter(Hud),
- Radius = 4f,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 30,
- TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 240, 148, 32, true, false, 128, 0, 0, 0, true),
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 30,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(160, 240, 148, 32, 0),
- Radius = 30,
- }
- );
- SentryWithCustomEngineeringDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(100, 0, 255, 0, 4),
- Radius = 16,
- },
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 64, 255, 64, 1),
- ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
- Radius = 16.0f,
- ShapePainter = new CircleShapePainter(Hud),
- },
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 240, 148, 32, 2),
- ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
- ShapePainter = new TriangleShapePainter(Hud),
- Radius = 4f,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 60,
- TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 240, 148, 32, true, false, 128, 0, 0, 0, true),
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 60,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(160, 240, 148, 32, 0),
- Radius = 30,
- }
- );
- }
- public void PaintWorld(WorldLayer layer)
- {
- var actors = Hud.Game.Actors;
- foreach (var actor in actors)
- {
- switch (actor.SnoActor.Sno)
- {
- case ActorSnoEnum._dh_sentry_addsshield:
- if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))
- {
- SentryDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- }
- else
- {
- SentryWithCustomEngineeringDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- }
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement