Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- using System.Linq;
- namespace Turbo.Plugins.RNN
- {
- public class SyphonBloodTarget : BasePlugin, IInGameTopPainter
- {
- public IFont TextFontRed { get; set; }
- public IFont TextFontGreen { get; set; }
- private SharpDX.DirectWrite.TextLayout layout { get; set; } = null;
- private string monsterText { get; set; } = null;
- private IFont monsterFont { get; set; } = null;
- public bool OnlyElites { get; set; }
- public int OffsetY { get; set; }
- public SyphonBloodTarget()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- OnlyElites = true;
- OffsetY = -72 ;
- TextFontRed = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 255, false, false, 255, 255, 0, 0, true);
- TextFontGreen = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 255, false, false, 255, 0, 120, 0, true);
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (clipState != ClipState.BeforeClip) return;
- if (!Hud.Game.IsInGame || Hud.Game.IsInTown) return;
- if (Hud.Game.Players.Any(p => p.HeroClassDefinition.HeroClass == HeroClass.Necromancer /*&& p.Powers.UsedNecromancerPowers.SiphonBlood != null*/ && p.Powers.BuffIsActive(487651))) // Funerary pick
- {
- var monsters = Hud.Game.AliveMonsters.Where(m => (!OnlyElites || m.IsElite) && m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_9_Visual_Effect_D, 453563) == 1);
- foreach (var monster in monsters)
- {
- if (monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_11_Visual_Effect_D, 453563) == 1)
- {
- monsterText = "600";
- monsterFont = TextFontGreen;
- }
- else
- {
- monsterText = "300";
- monsterFont = TextFontRed;
- }
- layout = (monster.IsSelected && Hud.Game.Me.Powers.BuffIsActive(453563))? monsterFont.GetTextLayout("[" + monsterText + "]") : monsterFont.GetTextLayout(monsterText); // monster selected && using yphon
- monsterFont.DrawText(layout, monster.FloorCoordinate.ToScreenCoordinate().X - layout.Metrics.Width/2.0f , monster.FloorCoordinate.ToScreenCoordinate().Y + OffsetY - layout.Metrics.Height/2.0f);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment