Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using SharpDX;
- using SharpDX.Direct2D1;
- using System;
- using System.Linq;
- using System.Globalization;
- using System.Collections.Generic;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.DAV
- {
- public class DAV_MonkRush : BasePlugin, IInGameWorldPainter {
- public float xPos { get; set; }
- public float yPos { get; set; }
- public float iconSize { get; set; }
- public IFont Font_Good { get; set; }
- public IFont Font_Warm { get; set; }
- public int Flurry_Min { get; set; }
- public bool showRadius { get; set; }
- public float ReleaseRaduis { get; set; }
- public IBrush Brush_Flurry { get; set; }
- public IBrush Brush_Release { get; set; }
- private ITexture Icon_COE { get; set; }
- private ITexture Icon_TRush { get; set; }
- private bool OK_COE { get; set; }
- private bool OK_Stack { get; set; }
- public DAV_MonkRush() {
- Enabled = true;
- }
- public override void Load(IController hud) {
- base.Load(hud);
- Flurry_Min = 20;
- showRadius = true;
- ReleaseRaduis = 20f;
- xPos = Hud.Window.Size.Width * 810 / 1920;
- yPos = Hud.Window.Size.Height * 160 / 1080;
- iconSize = Hud.Window.Size.Height * 40 / 1080;
- Brush_Flurry = Hud.Render.CreateBrush(255, 51, 51, 255, 2);
- Brush_Release = Hud.Render.CreateBrush(255, 255, 51, 51, 3);
- Font_Good = Hud.Render.CreateFont("arial", 9, 255, 51, 255, 51, true, false, 255, 0, 0, 0, true);
- Font_Warm = Hud.Render.CreateFont("arial", 9, 255, 255, 51, 51, true, false, 255, 0, 0, 0, true);
- Icon_TRush = Hud.Texture.GetTexture(2984253060);
- Icon_COE = Hud.Texture.GetTexture(1541236666);
- }
- public void PaintWorld(WorldLayer layer) {
- if (Hud.Game.SpecialArea != SpecialArea.GreaterRift) return;
- if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Monk) return;
- if (!Hud.Game.Me.Powers.BuffIsActive(484106, 0)) return; // NO "Won Khim Lau" Power
- if (!Hud.Game.Me.Powers.UsedSkills.Any(x => x.SnoPower.Sno == 121442 && x.RuneNameEnglish == "Flurry")) return;
- if (showRadius)
- Brush_Flurry.DrawWorldEllipse(15, -1, Hud.Game.Me.FloorCoordinate);
- // Stack of Flurry
- Icon_TRush?.Draw(xPos, yPos, iconSize, iconSize);
- var rushBuff = Hud.Game.Me.Powers.GetBuff(121442);
- if (rushBuff != null) {
- var stack = rushBuff.IconCounts[3];
- OK_Stack = stack >= Flurry_Min;
- var usedFont = OK_Stack ? Font_Good : Font_Warm;
- var layout = usedFont.GetTextLayout(stack.ToString());
- usedFont.DrawText(layout, xPos + (iconSize - layout.Metrics.Width) / 2f, yPos + (iconSize - layout.Metrics.Height) / 2f);
- }
- else OK_Stack = false;
- // COE
- if (Hud.Game.Me.Powers.BuffIsActive(430674, 0)) {
- Icon_COE.Draw(xPos + iconSize, yPos, iconSize, iconSize);
- var coeBuff = Hud.Game.Me.Powers.GetBuff(430674);
- if (coeBuff == null) return;
- var coeLeft = coeBuff.TimeLeftSeconds[8];
- if (coeLeft >= 16) coeLeft -= 16;
- else if (coeLeft <= 4) coeLeft += 4;
- else return;
- OK_COE = coeLeft <= 4d;
- var usedFont = OK_COE ? Font_Good : Font_Warm;
- var layout = usedFont.GetTextLayout(coeLeft.ToString("F1"));
- usedFont.DrawText(layout, xPos + iconSize * 1.5f - layout.Metrics.Width / 2f, yPos + (iconSize - layout.Metrics.Height) / 2f);
- }
- else return;
- if (OK_COE && OK_Stack) {
- Brush_Release.DrawRectangle(xPos, yPos, 2 * iconSize, iconSize);
- Brush_Release.DrawWorldEllipse(ReleaseRaduis, -1, Hud.Game.Me.FloorCoordinate);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement