Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.30 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System;
  4. using Turbo.Plugins.Default;
  5. namespace Turbo.Plugins.Zy
  6. {
  7.     public class MissingCursesPlugin : BasePlugin, IInGameWorldPainter
  8.     {
  9.         public IFont TextFontFrailty { get; set; }
  10.         public IFont TextFontLeech { get; set; }
  11.         public IFont TextFontDecrepify { get; set; }
  12.        
  13.         public MissingCursesPlugin()
  14.         {
  15.             Enabled = true;
  16.         }
  17.  
  18.         public override void Load(IController hud)
  19.         {
  20.             base.Load(hud);
  21.  
  22.             TextFontFrailty = Hud.Render.CreateFont("tahoma", 5, 255, 128, 0, 128, false, false, true);
  23.             TextFontLeech = Hud.Render.CreateFont("tahoma", 5, 255, 255, 0, 0, false, false, true);
  24.             TextFontDecrepify = Hud.Render.CreateFont("tahoma", 5, 255, 64, 224, 208, false, false, true);
  25.         }
  26.  
  27.         public void PaintWorld(WorldLayer layer)
  28.         {
  29.             if (Hud.Render.UiHidden) return;
  30.             var w1 = 30;
  31.             var py = Hud.Window.Size.Height / 600;
  32.             var monsters = Hud.Game.AliveMonsters.Where(x => x.IsAlive);
  33.  
  34.             var NecroIngame = false;
  35.             foreach (var player in Hud.Game.Players)
  36.             {
  37.                 if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
  38.                 {
  39.                     NecroIngame = true;
  40.                 }
  41.             }
  42.             if (NecroIngame)
  43.             {
  44.                 foreach (var monster in monsters)
  45.                 {
  46.                     var textFrailty = "";
  47.                     var textLeech = "";
  48.                     var textDecrepify = "";
  49.                     var test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471845);//471845   1   power: Frailty
  50.                     if (test == -1)
  51.                     {
  52.                         textFrailty += "F";
  53.                     }
  54.                     test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471869);//471869   1   power: Leech
  55.                     if (test == -1)
  56.                     {
  57.                         textLeech += "L";
  58.                     }
  59.                     test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471738);//471738   1   power: Decrepify
  60.                     if (test == -1)
  61.                     {
  62.                         textDecrepify += "D";
  63.                     }
  64.                     var layoutFrailty = TextFontFrailty.GetTextLayout(textFrailty);
  65.                     var layoutLeech = TextFontLeech.GetTextLayout(textLeech);
  66.                     var layoutDecrepify = TextFontDecrepify.GetTextLayout(textDecrepify);
  67.                     var w = monster.CurHealth * w1 / monster.MaxHealth;
  68.                     var monsterX = monster.FloorCoordinate.ToScreenCoordinate().X - w1 / 2;
  69.                     var monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y + py * 12;
  70.                     var buffY = monsterY - 1;
  71.                     var hpX = monsterX + 7;
  72.  
  73.                     TextFontFrailty.DrawText(layoutFrailty, hpX - 2, buffY);
  74.                     TextFontLeech.DrawText(layoutLeech, hpX + 6, buffY);
  75.                     TextFontDecrepify.DrawText(layoutDecrepify, hpX + 14, buffY);
  76.                 }
  77.             }
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement