Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Globalization;
- using Turbo.Plugins.Default;
- using System.Linq;
- using System;
- namespace Turbo.Plugins.DavPlayer
- {
- public class DAV_WizChantodoPlugin : BasePlugin, IInGameTopPainter {
- public TopLabelDecorator ArchonDecorator { get; set; }
- public TopLabelDecorator ChantodoDecorator { get; set; }
- public IBrush GreenBrush { get; set; }
- public IBrush OrangeBrush { get; set; }
- public IBrush RedBrush { get; set; }
- public IBrush RangeBrush { get; set; }
- public IBrush ZeiBrush { get; set; }
- public float iconSize { get; set; }
- public float XPos { get; set; }
- public float YPos { get; set; }
- private int ChantodoStack { get; set; }
- private double ArchonLeft { get; set; }
- public DAV_WizChantodoPlugin() {
- Enabled = true;
- }
- public override void Load(IController hud) {
- base.Load(hud);
- XPos = Hud.Window.Size.Width * 0.45f;
- YPos = Hud.Window.Size.Height * 0.611f - 11f;
- iconSize = Hud.Window.Size.Height * 9.35f / 240f;
- GreenBrush = Hud.Render.CreateBrush(204, 0, 255, 0, 3);
- OrangeBrush = Hud.Render.CreateBrush(204, 255, 255, 51, 3);
- RedBrush = Hud.Render.CreateBrush(204, 255, 0, 0, 3);
- RangeBrush = Hud.Render.CreateBrush(204, 51, 153, 255, 3);
- ZeiBrush = Hud.Render.CreateBrush(255,192,96,0, 1);
- ChantodoDecorator = new TopLabelDecorator(Hud) {
- BackgroundTexture1 = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_ArcaneOrb.NormalIconTextureId),
- TextFont = Hud.Render.CreateFont("arial", 9, 255, 0, 255, 0, true, false, 255, 0, 0, 0, true),
- TextFunc = () => ChantodoStack.ToString()
- };
- ArchonDecorator = new TopLabelDecorator(Hud) {
- BackgroundTexture1 = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Archon.NormalIconTextureId),
- TextFont = Hud.Render.CreateFont("arial", 9, 255, 255, 255, 255, true, false, 255, 255, 51, 51, true),
- TextFunc = () => ArchonLeft.ToString("F0")
- };
- }
- public void PaintTopInGame(ClipState clipState) {
- if (clipState != ClipState.BeforeClip) return;
- var me = Hud.Game.Me;
- if (me.HeroClassDefinition.HeroClass != HeroClass.Wizard) return;
- if (!me.Powers.BuffIsActive(440235, 0)) return;
- var archon = me.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
- if (archon != null) {
- ArchonLeft = archon.TimeLeftSeconds[2];
- if (ArchonLeft > 0) {
- if (ArchonLeft >= 10) ArchonDecorator.BackgroundBrush = GreenBrush;
- else if (ArchonLeft >= 5) ArchonDecorator.BackgroundBrush = OrangeBrush;
- else ArchonDecorator.BackgroundBrush = RedBrush;
- ArchonDecorator.Paint(XPos + 3*iconSize, YPos, iconSize, iconSize, HorizontalAlign.Center);
- RangeBrush.DrawWorldEllipse(24, -1, me.FloorCoordinate);
- if (me.Powers.BuffIsActive(Hud.Sno.SnoPowers.ZeisStoneOfVengeancePrimary.Sno, 0)) { // 403468
- ZeiBrush.DrawWorldEllipse(10, -1, me.FloorCoordinate);
- ZeiBrush.DrawWorldEllipse(20, -1, me.FloorCoordinate);
- }
- return;
- }
- }
- ChantodoStack = me.Powers.GetBuff(440235).IconCounts[0];
- if (ChantodoStack >= 18) ChantodoDecorator.BackgroundBrush = GreenBrush;
- else if (ChantodoStack >= 10) ChantodoDecorator.BackgroundBrush = OrangeBrush;
- else ChantodoDecorator.BackgroundBrush = RedBrush;
- ChantodoDecorator.Paint(XPos, YPos, iconSize, iconSize, HorizontalAlign.Center);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement