Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- using Turbo.Plugins.Miqui.CustomizableActorDecorators;
- namespace Turbo.Plugins.Miqui
- {
- class PhantasmDecoratorCustomizer : BasePlugin, ICustomizer {
- private class MainSpiritBarrageDecorator: IActorDecorator
- {
- private WorldDecoratorCollection MainSpiritBarrageCircle { get ; set ; }
- public MainSpiritBarrageDecorator(IController hud)
- {
- MainSpiritBarrageCircle = new WorldDecoratorCollection(
- new GroundCircleDecorator(hud)
- {
- Brush = hud.Render.CreateBrush(100, 130, 213, 255, 10),
- Radius = 9.5F,
- },
- new GroundLabelDecorator(hud)
- {
- CountDownFrom = 10,
- TextFont = hud.Render.CreateFont("tahoma", 9, 220, 190, 243, 255, true, false, 230, 0, 0, 0, true),
- },
- new GroundTimerDecorator(hud)
- {
- CountDownFrom = 10,
- BackgroundBrushEmpty = hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = hud.Render.CreateBrush(100, 130, 213, 255, 0),
- Radius = 30,
- }
- );
- }
- WorldDecoratorCollection IActorDecorator.getActorDecorator(IController hud, IActor actor)
- {
- return MainSpiritBarrageCircle;
- }
- }
- private class ExplosionSpiritBarrageDecorator: IActorDecorator
- {
- private WorldDecoratorCollection SolidExplosionSpiritBarrageCircle { get ; set ; }
- private WorldDecoratorCollection DashedExplosionSpiritBarrageCircle { get ; set ; }
- public ExplosionSpiritBarrageDecorator(IController hud)
- {
- // Shown when there is > 2 seconds left before explosion
- DashedExplosionSpiritBarrageCircle = new WorldDecoratorCollection(
- new GroundCircleDecorator(hud)
- {
- Brush = hud.Render.CreateBrush(100, 130, 213, 255, 3, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = 15F,
- },
- new GroundLabelDecorator(hud)
- {
- Enabled = false,
- CountDownFrom = 10,
- TextFont = hud.Render.CreateFont("tahoma", 9, 220, 190, 243, 255, true, false, 230, 0, 0, 0, true),
- },
- new GroundTimerDecorator(hud)
- {
- Enabled = false,
- CountDownFrom = 10,
- BackgroundBrushEmpty = hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = hud.Render.CreateBrush(100, 130, 213, 255, 0),
- Radius = 30,
- }
- );
- // Shown when there is < 2 seconds left before explosion
- SolidExplosionSpiritBarrageCircle = new WorldDecoratorCollection(
- new GroundCircleDecorator(hud)
- {
- Brush = hud.Render.CreateBrush(100, 130, 213, 255, 3),
- Radius = 15F,
- },
- new GroundLabelDecorator(hud)
- {
- Enabled = false,
- CountDownFrom = 10,
- TextFont = hud.Render.CreateFont("tahoma", 9, 220, 190, 243, 255, true, false, 230, 0, 0, 0, true),
- },
- new GroundTimerDecorator(hud)
- {
- Enabled = false,
- CountDownFrom = 10,
- BackgroundBrushEmpty = hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = hud.Render.CreateBrush(100, 130, 213, 255, 0),
- Radius = 30,
- }
- );
- }
- WorldDecoratorCollection IActorDecorator.getActorDecorator(IController hud, IActor actor)
- {
- int creationTick = actor.CreatedAtInGameTick;
- int currentTick = hud.Game.CurrentGameTick;
- int elapsedTimeSinceCreation = currentTick - creationTick;
- // 60 frames per second, 1 frame = 1 tick, so 8 seconds is 60 * 8 ticks
- if (elapsedTimeSinceCreation > 60 * 8)
- return SolidExplosionSpiritBarrageCircle;
- return DashedExplosionSpiritBarrageCircle;
- }
- }
- public PhantasmDecoratorCustomizer() {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- }
- public void Customize()
- {
- Hud.RunOnPlugin<CustomizableActorDecoratorsPlugin>(plugin =>
- {
- plugin.AddDecorator(ActorSnoEnum._wd_spiritbarragerune_aoe_ghostmodel, new MainSpiritBarrageDecorator(Hud));
- plugin.AddDecorator(ActorSnoEnum._wd_spiritbarragerune_aoe_ghostmodel, new ExplosionSpiritBarrageDecorator(Hud));
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement