Advertisement
RNNCode

GoblinsPlugin

Apr 6th, 2024 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 19.55 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Turbo.Plugins.RNN
  6. {
  7.     public class GoblinsPlugin : BasePlugin, IInGameWorldPainter, ICustomizer, INewAreaHandler, IAfterCollectHandler, IMonsterKilledHandler
  8.     {
  9.         private int MyIndex { get; set; } = -1;
  10.         private int LastTick { get; set; } = 0;
  11.         private int TotalGoblins { get; set; } = 0;
  12.         private bool foundGoblin { get; set; } = false;
  13.  
  14.         private Dictionary<double, bool> MaxHealthReapp { get; set; } = new Dictionary<double, bool>();
  15.         private Dictionary<ActorSnoEnum, GoblinData> GoblinsDic { get; set; } = new Dictionary<ActorSnoEnum, GoblinData>();
  16.         private Dictionary<string, int> GoblinsFound { get; set; } = new Dictionary<string, int>();
  17.  
  18.         public WorldDecoratorCollection PortalDecorator { get; set; }
  19.         public WorldDecoratorCollection MalevolentDecorator { get; set; }
  20.         public WorldDecoratorCollection BloodDecorator { get; set; }
  21.         public WorldDecoratorCollection OdiousDecorator { get; set; }
  22.         public WorldDecoratorCollection GemDecorator { get; set; }
  23.         public WorldDecoratorCollection GelatinousDecorator { get; set; }
  24.         public WorldDecoratorCollection GildedDecorator { get; set; }
  25.         public WorldDecoratorCollection InsufferableDecorator { get; set; }
  26.         public WorldDecoratorCollection MenageristDecorator { get; set; }
  27.         public WorldDecoratorCollection RainbowDecorator { get; set; }
  28.         public WorldDecoratorCollection FiendDecorator { get; set; }
  29.         public WorldDecoratorCollection TreasureDecorator { get; set; }
  30.         public WorldDecoratorCollection DevilhandDecorator { get; set; }
  31.         public WorldDecoratorCollection VisionDecorator { get; set; }
  32.  
  33.         private ITexture BGTexture { get; set; }
  34.         private ITexture IMGTexture { get; set; }
  35.         private float widthBG { get; set; } = 0;
  36.         private float widthIMG { get; set; } = 0;
  37.         private bool fixLoad  {get; set; } = true;
  38.         private IFont FontText { get; set; }
  39.  
  40.         public bool EnableSpeak { get; set; }
  41.         public string MalevolentSpeak { get; set; }
  42.         public string BloodSpeak { get; set; }
  43.         public string OdiousSpeak { get; set; }
  44.         public string GemSpeak { get; set; }
  45.         public string GelatinousSpeak { get; set; }
  46.         public string GelatinousSplit1Speak { get; set; }
  47.         public string GelatinousSplit2Speak { get; set; }
  48.         public string GildedSpeak { get; set; }
  49.         public string InsufferableSpeak { get; set; }
  50.         public string MenageristSpeak { get; set; }
  51.         public string RainbowSpeak { get; set; }
  52.         public string FiendSpeak { get; set; }
  53.         public string TreasureSpeak { get; set; }
  54.         public string DevilhandSpeak { get; set; }
  55.  
  56.         public string VisionSpeak { get; set; }
  57.         public string TextVisionGoblin { get; set; }
  58.  
  59.         public bool ShowCounter { get; set; }
  60.         public float xPor { get; set; }
  61.         public float yPor { get; set; }
  62.         public float SizeMultiplier { get; set; }
  63.         public float Opacity { get; set; }
  64.  
  65.         public GoblinsPlugin()
  66.         {
  67.             Enabled = true;
  68.         }
  69.  
  70.         public class GoblinData
  71.         {
  72.             public int Amount { get; set; } = 0;
  73.             public string TextSpeak { get; set; } = null;
  74.             public WorldDecoratorCollection Decorator { get; set; }
  75.  
  76.             public GoblinData(string textspeak, WorldDecoratorCollection decorator)
  77.             {
  78.                 this.TextSpeak = textspeak;
  79.                 this.Decorator = decorator;
  80.             }
  81.         }
  82.  
  83.         public override void Load(IController hud)
  84.         {
  85.             base.Load(hud);
  86.             Order = 30001;
  87.  
  88.             EnableSpeak = true;
  89.                                         // null -> NameLocalized , "" -> not Speak
  90.             MalevolentSpeak = null;     // "Malevolent Tormentor"
  91.             BloodSpeak = null;          // "Blood Thief"
  92.             OdiousSpeak = null;         // "Odious Collector"
  93.             GemSpeak = null;            // "Gem Hoarder"
  94.             GelatinousSpeak = null;     // "Gelatinous Sire"
  95.             GelatinousSplit1Speak = ""; // "" -> not Speak
  96.             GelatinousSplit2Speak = "";
  97.             GildedSpeak = null;         // "Gilded Baron"
  98.             InsufferableSpeak = null;   // "Insufferable Miscreant"
  99.             MenageristSpeak = null;     // "Menagerist Goblin"
  100.             RainbowSpeak = null;        // "Rainbow Goblin"
  101.             FiendSpeak = null;          // "Treasure Fiend"
  102.             TreasureSpeak = null;       // "Treasure Goblin"
  103.             DevilhandSpeak = null;      // "Snitchley"
  104.  
  105.             VisionSpeak = "";           // "Vision Goblin" speak when found. "" for nothing (ex. if you are installed EnmityVisionplugin)
  106.             TextVisionGoblin = "Vision Goblin"; // to differentiate it from the treasure goblins, will be used instead of namelocalized for report and decorators
  107.  
  108.             ShowCounter = true;
  109.             xPor = 0.324f;          // To set the x coordinate of the icon
  110.             yPor = 0.850f;          // To set the y coordinate of the icon
  111.             Opacity = 0.80f;        // 0f..1f  Opacity for icon texture
  112.             SizeMultiplier = 0.5f;  // Size multiplier for icon
  113.  
  114.  
  115.             BGTexture = Hud.Texture.GetTexture(672253601);  // 679903159 , 672253601
  116.             IMGTexture = Hud.Texture.GetTexture(2605755780);
  117.             CreateDecorators();
  118.         }
  119.  
  120.         public void Customize()
  121.         {
  122.             Hud.TogglePlugin<GoblinPlugin>(false);
  123.  
  124.             GoblinsDic.Add( ActorSnoEnum._p1_treasuregoblin_tentacle_a, new GoblinData(RainbowSpeak, RainbowDecorator) );
  125.             GoblinsDic.Add( ActorSnoEnum._p1_treasuregobin_a_unique_greedminion, new GoblinData(FiendSpeak, FiendDecorator) );
  126.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_a, new GoblinData(TreasureSpeak, TreasureDecorator) ); // "Treasure Goblin"
  127.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_b, new GoblinData(OdiousSpeak, OdiousDecorator)    );  // "Odious Collector"
  128.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_c, new GoblinData(GemSpeak, GemDecorator)  );          // "Gem Hoarder"
  129.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_c_unique_devilshand, new GoblinData(DevilhandSpeak, DevilhandDecorator) );
  130.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_d_splitter, new GoblinData(GelatinousSpeak, GelatinousDecorator)   );          // Gelatinous Sire
  131.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_d_splitter_02, new GoblinData(GelatinousSplit1Speak, GelatinousDecorator) );   // Gelatinous Spawn
  132.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_d_splitter_03, new GoblinData(GelatinousSplit2Speak, GelatinousDecorator) );   // Gelatinous Spawn
  133.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_e, new GoblinData(InsufferableSpeak, InsufferableDecorator) ); // "Insufferable Miscreant"
  134.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_f, new GoblinData(BloodSpeak, BloodDecorator) );           // "Blood Thief"
  135.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_h, new GoblinData(MalevolentSpeak, MalevolentDecorator) ); // "Malevolent Tormentor"
  136.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_j, new GoblinData(GildedSpeak, GildedDecorator) );         // "Gilded Baron"
  137.             GoblinsDic.Add( ActorSnoEnum._treasuregoblin_k, new GoblinData(MenageristSpeak, MenageristDecorator) );
  138.                                         // -- Vision --"
  139.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_a, GoblinsDic[ActorSnoEnum._treasuregoblin_a] );   // Value by reference
  140.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_b, GoblinsDic[ActorSnoEnum._treasuregoblin_b] );
  141.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_c, GoblinsDic[ActorSnoEnum._treasuregoblin_c] );
  142.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_e, GoblinsDic[ActorSnoEnum._treasuregoblin_e] );
  143.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_f, GoblinsDic[ActorSnoEnum._treasuregoblin_f] );
  144.             GoblinsDic.Add( ActorSnoEnum._p76_treasuregoblin_a_noportal, new GoblinData(VisionSpeak, VisionDecorator) );
  145.                                         // -- NightMares --
  146.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_a, GoblinsDic[ActorSnoEnum._treasuregoblin_a] );
  147.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_b, GoblinsDic[ActorSnoEnum._treasuregoblin_b] );
  148.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_c, GoblinsDic[ActorSnoEnum._treasuregoblin_c] );
  149.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_e, GoblinsDic[ActorSnoEnum._treasuregoblin_e] );
  150.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_f, GoblinsDic[ActorSnoEnum._treasuregoblin_f] );
  151.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_h, GoblinsDic[ActorSnoEnum._treasuregoblin_h] );
  152.             GoblinsDic.Add( ActorSnoEnum._p73_treasuregoblin_j, GoblinsDic[ActorSnoEnum._treasuregoblin_j] );
  153.  
  154.             FontText = Hud.Render.CreateFont("arial", 18f * SizeMultiplier, 255, 255, 255, 255, false, false, 255, 0, 0, 0, true);
  155.         }
  156.  
  157.         public void OnNewArea(bool newGame, ISnoArea area)
  158.         {
  159.             if (newGame || (MyIndex != Hud.Game.Me.Index) )
  160.             {
  161.                 MyIndex = Hud.Game.Me.Index;
  162.                 MaxHealthReapp.Clear();
  163.                 GoblinsFound.Clear();
  164.                 foreach(var d in GoblinsDic) { d.Value.Amount = 0; }
  165.                 LastTick = 0;
  166.                 foundGoblin = false;
  167.                 TotalGoblins = 0;
  168.             }
  169.         }
  170.  
  171.         private string GoblinsText()
  172.         {
  173.             string text = string.Format("[ {0} Goblins ]", TotalGoblins);
  174.             foreach(var d in GoblinsFound.OrderByDescending(o => o.Value))
  175.             {
  176.                 text += string.Format("\n{0} {1}", d.Value, d.Key);
  177.             }
  178.             return text;
  179.         }
  180.  
  181.         private void CreateDecorators()
  182.         {
  183.             float offsetH = 5.0f , size1 = 8f , size2 = 6f;
  184.  
  185.             PortalDecorator = new WorldDecoratorCollection(
  186.                 new MapShapeDecorator(Hud) {
  187.                     Brush = Hud.Render.CreateBrush(180, 255, 255, 255, 0),
  188.                     Radius = 8.0f
  189.                 },
  190.                 new MapShapeDecorator(Hud) {
  191.                     Brush = Hud.Render.CreateBrush(180, 120, 0, 0, 0),
  192.                     Radius = 2.5f
  193.                 }
  194.             );
  195.             MalevolentDecorator = new WorldDecoratorCollection(
  196.                 new GroundLabelDecorator(Hud) {
  197.                     BackgroundBrush = Hud.Render.CreateBrush(180, 183, 91, 0, 0),
  198.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  199.                 },
  200.                 new MapLabelDecorator(Hud) {
  201.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 183, 91, 0, false, false, 128, 0, 0, 0, true),
  202.                     RadiusOffset = offsetH,
  203.                 }
  204.             );
  205.             BloodDecorator = new WorldDecoratorCollection(
  206.                 new GroundLabelDecorator(Hud) {
  207.                     BackgroundBrush = Hud.Render.CreateBrush(180, 255, 0, 128, 0),
  208.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 255, 255, 255, true, false, false)
  209.                 },
  210.                 new MapLabelDecorator(Hud) {
  211.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 255, 0, 128, false, false, 128, 0, 0, 0, true),
  212.                     RadiusOffset = offsetH,
  213.                 }
  214.             );
  215.             OdiousDecorator = new WorldDecoratorCollection(
  216.                 new GroundLabelDecorator(Hud) {
  217.                     BackgroundBrush = Hud.Render.CreateBrush(180, 0, 255, 0, 0),
  218.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  219.                 },
  220.                 new MapLabelDecorator(Hud) {
  221.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 0, 255, 0, false, false, 128, 0, 0, 0, true),
  222.                     RadiusOffset = offsetH,
  223.                 }
  224.             );
  225.             GemDecorator = new WorldDecoratorCollection(
  226.                 new GroundLabelDecorator(Hud) {
  227.                     BackgroundBrush = Hud.Render.CreateBrush(180, 220, 220, 220, 0),
  228.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  229.                 },
  230.                 new MapLabelDecorator(Hud) {
  231.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 220, 220, 220, false, false, 128, 0, 0, 0, true),
  232.                     RadiusOffset = offsetH,
  233.                 }
  234.             );
  235.             GelatinousDecorator = new WorldDecoratorCollection(
  236.                 new GroundLabelDecorator(Hud) {
  237.                     BackgroundBrush = Hud.Render.CreateBrush(200, 50, 50, 200, 0),
  238.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 255, 255, 255, true, false, false)
  239.                 },
  240.                 new MapLabelDecorator(Hud) {
  241.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 62, 158, 255, false, false, 128, 0, 0, 0, true),
  242.                     RadiusOffset = offsetH,
  243.                 }
  244.             );
  245.             GildedDecorator = new WorldDecoratorCollection(
  246.                 new GroundLabelDecorator(Hud) {
  247.                     BackgroundBrush = Hud.Render.CreateBrush(180, 255, 255, 0, 0),
  248.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  249.                 },
  250.                 new MapLabelDecorator(Hud) {
  251.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 255, 255, 0, false, false, 128, 0, 0, 0, true),
  252.                     RadiusOffset = offsetH,
  253.                 }
  254.             );
  255.             InsufferableDecorator = new WorldDecoratorCollection(
  256.                 new GroundLabelDecorator(Hud) {
  257.                     BackgroundBrush = Hud.Render.CreateBrush(180, 64, 128, 128, 0),
  258.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  259.                 },
  260.                 new MapLabelDecorator(Hud) {
  261.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 64, 128, 128, false, false, 128, 0, 0, 0, true),
  262.                     RadiusOffset = offsetH,
  263.                 }
  264.             );
  265.             MenageristDecorator = new WorldDecoratorCollection(
  266.                 new GroundLabelDecorator(Hud) {
  267.                     BackgroundBrush = Hud.Render.CreateBrush(180, 56, 1, 185, 0),
  268.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 255, 255, 255, true, false, false)
  269.                 },
  270.                 new MapLabelDecorator(Hud) {
  271.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 200, 25, 1, 185, true, false, 128, 255, 255, 255, true),
  272.                     RadiusOffset = offsetH,
  273.                 }
  274.             );
  275.             RainbowDecorator = new WorldDecoratorCollection(
  276.                 new GroundLabelDecorator(Hud) {
  277.                     BackgroundBrush = Hud.Render.CreateBrush(160, 196, 107, 255, 0),
  278.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  279.                 },
  280.                 new MapLabelDecorator(Hud) {
  281.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 196, 107, 255, false, false, 128, 0, 0, 0, true),
  282.                     RadiusOffset = offsetH,
  283.                 }
  284.             );
  285.             FiendDecorator  = new WorldDecoratorCollection(
  286.                 new GroundLabelDecorator(Hud) {
  287.                     BackgroundBrush = Hud.Render.CreateBrush(160, 255, 163, 15, 0),
  288.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  289.                 },
  290.                 new MapLabelDecorator(Hud) {
  291.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 255, 163, 15, false, false, 128, 0, 0, 0, true),
  292.                     RadiusOffset = offsetH,
  293.                 }
  294.             );
  295.             TreasureDecorator = new WorldDecoratorCollection(
  296.                 new GroundLabelDecorator(Hud) {
  297.                     BackgroundBrush = Hud.Render.CreateBrush(200, 255, 255, 128, 0),
  298.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  299.                 },
  300.                 new MapLabelDecorator(Hud) {
  301.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 255, 255, 128, false, false, 128, 0, 0, 0, true),
  302.                     RadiusOffset = offsetH,
  303.                 }
  304.             );
  305.             DevilhandDecorator = new WorldDecoratorCollection(
  306.                 new GroundLabelDecorator(Hud) {
  307.                     BackgroundBrush = Hud.Render.CreateBrush(200, 255, 128, 255, 0),
  308.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 0, 0, 0, true, false, false)
  309.                 },
  310.                 new MapLabelDecorator(Hud) {
  311.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 255, 128, 255, false, false, 128, 0, 0, 0, true),
  312.                     RadiusOffset = offsetH,
  313.                 }
  314.             );
  315.             VisionDecorator = new WorldDecoratorCollection(
  316.                 new GroundLabelDecorator(Hud) {
  317.                     BackgroundBrush = Hud.Render.CreateBrush(200, 50, 150, 250, 0),
  318.                     TextFont = Hud.Render.CreateFont("tahoma", size1, 255, 255, 255, 255, true, false, false)
  319.                 },
  320.                 new MapLabelDecorator(Hud) {
  321.                     LabelFont = Hud.Render.CreateFont("tahoma", size2, 255, 62, 158, 255, false, false, 128, 0, 0, 0, true),
  322.                     RadiusOffset = offsetH,
  323.                 }
  324.             );
  325.  
  326.         }
  327.  
  328.         public void AfterCollect()
  329.         {
  330.             if (!Hud.Game.IsInGame || Hud.Game.Me.InGreaterRiftRank > 0) return;
  331.  
  332.             var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);
  333.             foreach (var goblin in goblins)
  334.             {
  335.                 if (goblin.MaxHealth > 0)
  336.                 {
  337.                     if (MaxHealthReapp.TryGetValue(goblin.MaxHealth, out var r))
  338.                     {
  339.                         if (r == false)
  340.                         {
  341.                             MaxHealthReapp[goblin.MaxHealth] = true;
  342.                             LastTick = Hud.Game.CurrentGameTick;
  343.                             foundGoblin = true;
  344.                             var name = (goblin.SnoActor.Sno == ActorSnoEnum._p76_treasuregoblin_a_noportal && !string.IsNullOrEmpty(TextVisionGoblin))?TextVisionGoblin:goblin.SnoMonster.NameLocalized;
  345.                             if (!GoblinsDic.TryGetValue(goblin.SnoActor.Sno,out var data))
  346.                             {
  347.                                 //Hud.TextLog.Log("GoblinsData",string.Format("?? \"{0}\" => A:{1} , M:{2} , \"{3}\" , \"{4}\" , P:{5} ",
  348.                                 //goblin.SnoActor.Sno,(int)goblin.SnoActor.Sno,goblin.SnoMonster.Sno,goblin.SnoMonster.NameLocalized,goblin.SnoMonster.NameEnglish, goblin.SnoMonster.Priority),false,true);
  349.                                 data = GoblinsDic[ActorSnoEnum._treasuregoblin_a];
  350.                             }
  351.                             else
  352.                             {
  353.                                 if (data.TextSpeak == null) { data.TextSpeak = name; }
  354.                             }
  355.                             data.Amount += 1;
  356.                             if ( goblin.SnoActor.Sno != ActorSnoEnum._treasuregoblin_d_splitter_02 && goblin.SnoActor.Sno != ActorSnoEnum._treasuregoblin_d_splitter_03 )
  357.                             {
  358.                                 TotalGoblins += 1;
  359.                                 if (GoblinsFound.TryGetValue(name,out var c))   { GoblinsFound[name] = c + 1; }
  360.                                 else { GoblinsFound.Add(name,1); }
  361.                             }
  362.                         }
  363.                     }
  364.                     else { MaxHealthReapp.Add(goblin.MaxHealth, false); }
  365.                 }
  366.             }
  367.             if (foundGoblin && EnableSpeak && Hud.Game.CurrentGameTick - LastTick > 60)
  368.             {
  369.                 foreach(var d in GoblinsDic)
  370.                 {
  371.                     var n = d.Value.Amount;
  372.                     if (n > 0)
  373.                     {
  374.                         var msg = d.Value.TextSpeak ?? "Goblin";
  375.                         if (!string.IsNullOrEmpty(msg))
  376.                         {
  377.                             Hud.Sound.Speak( ((n > 1)? n.ToString() : "") + msg);
  378.                         }
  379.                         d.Value.Amount = 0;
  380.                     }
  381.                 }
  382.                 foundGoblin = false;
  383.             }
  384.         }
  385.  
  386.         public void OnMonsterKilled(IMonster monster)
  387.         {
  388.             if (monster.SnoMonster.Priority == MonsterPriority.goblin && monster.MaxHealth > 0)
  389.             {
  390.                 if (MaxHealthReapp.TryGetValue(monster.MaxHealth, out var r) /*&& r*/)
  391.                 {
  392.                     var n = MaxHealthReapp.Count;
  393.                     MaxHealthReapp.Remove(monster.MaxHealth);
  394.                     //Hud.TextLog.Log("GoblinsKill",string.Format("?? \"{0}\" => A:{1} , M:{2} , \"{3}\" , \"{4}\" , P:{5} , Reapp:{6}, MaxHealth:{7}, Count:{8}",
  395.                     //monster.SnoActor.Sno,(int)monster.SnoActor.Sno,monster.SnoMonster.Sno,monster.SnoMonster.NameLocalized,monster.SnoMonster.NameEnglish, monster.SnoMonster.Priority, r, monster.MaxHealth, MaxHealthReapp.Count
  396.                     //),false,true);
  397.                 }
  398.             }
  399.         }
  400.  
  401.         public void PaintWorld(WorldLayer layer)
  402.         {
  403.             if ( (!Hud.Game.IsInGame) || (Hud.Game.Me.InGreaterRiftRank > 0) ) return;
  404.  
  405.             var portals = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._treasuregoblin_portal_open);
  406.             foreach (var actor in portals)
  407.             {
  408.                 PortalDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  409.             }
  410.  
  411.             var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);
  412.             foreach (var goblin in goblins)
  413.             {
  414.                 if (!GoblinsDic.TryGetValue(goblin.SnoActor.Sno,out var data))
  415.                 {
  416.                     data = GoblinsDic[ActorSnoEnum._treasuregoblin_a];
  417.                 }
  418.                 (data.Decorator).Paint(layer, goblin, goblin.FloorCoordinate, (goblin.SnoActor.Sno == ActorSnoEnum._p76_treasuregoblin_a_noportal)?TextVisionGoblin:goblin.SnoMonster.NameLocalized);
  419.             }
  420.  
  421.             if (ShowCounter)
  422.             {
  423.                 var x = Hud.Window.Size.Width * xPor; var y = Hud.Window.Size.Height * yPor;
  424.                 widthBG = BGTexture.Width *  Hud.Window.Size.Height/1200.0f * SizeMultiplier; widthIMG = IMGTexture.Width *  Hud.Window.Size.Height/1200.0f * SizeMultiplier;
  425.                 BGTexture.Draw(x, y, widthBG, widthBG, Opacity);
  426.                 IMGTexture.Draw(x + (widthBG - widthIMG)/2, y + (widthBG - widthIMG)/2, widthIMG, widthIMG, Opacity);
  427.                 if (Hud.Window.CursorInsideRect(x, y, widthBG, widthBG))
  428.                 {
  429.                     Hud.Render.SetHint(GoblinsText());
  430.                 }
  431.                 var layout = FontText.GetTextLayout(TotalGoblins.ToString());
  432.                 FontText.DrawText(layout,x + (widthBG - layout.Metrics.Width)/2,y + (widthBG - layout.Metrics.Height)/2);
  433.             }
  434.         }
  435.     }
  436. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement