private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref) { if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions) { return; //no minions } if (m.SummonerAcdDynamicId != 0) { return; //no clones } var w = m.CurHealth * w2 / m.MaxHealth; var per = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor) + "%"); var y = YPos + py * 8 * yref; IBrush cBrush = null; IFont cFont = null; //Brush selection switch (m.Rarity) { case ActorRarity.Boss: cBrush = BossBrush; break; case ActorRarity.Champion: cBrush = ChampionBrush; break; case ActorRarity.Rare: cBrush = RareBrush; break; case ActorRarity.RareMinion: cBrush = RareMinionBrush; break; default: cBrush = BackgroundBrush; break; } //Jugger Highlight if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)) { cFont = RedFont; cBrush = RareJuggerBrush; } else { cFont = NameFont; } //Missing Highlight if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen) { var missing = RedFont.GetTextLayout("⚠"); RedFont.DrawText(missing, XPos - 17, y - py); } //Circle Non-Clones and Boss //if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox) // HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty); //Show Debuffs on Monster if (ShowDebuffAndCC) { string textDebuff = null; if (m.Locust) { textDebuff += (textDebuff == null ? "" : ", ") + "Locust"; } //if (m.Palmed) textDebuff += (textDebuff == null ? "" : ", ") + "Palm"; if (m.Haunted) { textDebuff += (textDebuff == null ? "" : ", ") + "Haunt"; } if (m.MarkedForDeath) { textDebuff += (textDebuff == null ? "" : ", ") + "Mark"; } if (m.Strongarmed) { textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm"; } string textCC = null; //if (m.Frozen) textCC += (textCC == null ? "" : ", ") + "Frozen"; //if (m.Chilled) textCC += (textCC == null ? "" : ", ") + "Chill"; //if (m.Slow) textCC += (textCC == null ? "" : ", ") + "Slow"; //if (m.Stunned) textCC += (textCC == null ? "" : ", ") + "Stun"; if (m.Invulnerable) { textCC += (textCC == null ? "" : ", ") + "Invulnerable"; } //if (m.Blind) textCC += (textCC == null ? "" : ", ") + "Blind"; var d = LightFont.GetTextLayout(textDebuff + (textDebuff != null && textCC != null ? " | " : "") + textCC); LightFont.DrawText(d, XPos + 65 + w2, y - py); } //Draw Rectangles BackgroundBrush.DrawRectangle(XPos, y, w2, h); BorderBrush.DrawRectangle(XPos, y, w2, h); cBrush.DrawRectangle(XPos, y, (float)w, h); LightFont.DrawText(per, XPos + 8 + w2, y - py); //Draw MonsterType if (ShowMonsterType) { var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized); cFont.DrawText(name, XPos + 3, y - py); } //increase linecount yref += 1.0f; }
private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref) { if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions) { return; //no minions } if (m.SummonerAcdDynamicId != 0) { return; //no clones } var wint = m.CurHealth / m.MaxHealth; string whptext; if ((wint < 0) || (wint > 1)) { wint = 1; whptext = "bug"; } else { whptext = (wint * 100).ToString(PercentageDescriptor) + "%"; } var w = wint * w2; var per = LightFont.GetTextLayout(whptext); var y = YPos + py * 8 * yref; // IBrush cBrush = null; // IFont cFont = null; cBrush = null; cFont = null; //Brush selection switch (m.Rarity) { case ActorRarity.Boss: cBrush = BossBrush; break; case ActorRarity.Champion: cBrush = ChampionBrush; break; case ActorRarity.Rare: cBrush = RareBrush; break; case ActorRarity.RareMinion: cBrush = RareMinionBrush; break; default: cBrush = BackgroundBrush; break; } //Jugger Highlight if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)) { cFont = RedFont; cBrush = RareJuggerBrush; } else { cFont = NameFont; } //Missing Highlight if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen) { var missing = RedFont.GetTextLayout("\u26A0"); RedFont.DrawText(missing, XPos - 17, y - py); } //Circle Non-Clones and Boss if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox) { HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty); } string d = string.Empty; //Show Debuffs on Monster if (ShowDebuffAndCC) { string textDebuff = null; if (m.Locust) { textDebuff += (textDebuff == null ? "" : ", ") + "Locust"; } if (m.Palmed) { textDebuff += (textDebuff == null ? "" : ", ") + "Palm"; } if (m.Haunted) { textDebuff += (textDebuff == null ? "" : ", ") + "Haunt"; } if (m.MarkedForDeath) { textDebuff += (textDebuff == null ? "" : ", ") + "Mark"; } //if (m.Strongarmed) textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm"; // No funciona, reemplazado por otro código if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 318772) == 1) //318772 2 power: ItemPassive_Unique_Ring_590_x1 { textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm"; } string textCC = null; if (m.Frozen) { textCC += (textCC == null ? "" : ", ") + "Frozen"; } if (m.Chilled) { textCC += (textCC == null ? "" : ", ") + "Chill"; } if (m.Slow) { textCC += (textCC == null ? "" : ", ") + "Slow"; } if (m.Stunned) { textCC += (textCC == null ? "" : ", ") + "Stun"; } if (m.Invulnerable) { textCC += (textCC == null ? "" : ", ") + "Invulnerable"; } if (m.Blind) { textCC += (textCC == null ? "" : ", ") + "Blind"; } if (textDebuff != null) { d = textDebuff; } if (textCC != null) { d += ((d != string.Empty)? " | ":"") + textCC; } } if (ShowCurses) { string Curses = null; if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471845) == 1) //471845 1 power: Frailty { Curses += (Curses == null ? "" : " ") + "F"; } if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471869) == 1) //471869 1 power: Leech { Curses += (Curses == null ? "" : " ") + "L"; } if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471738) == 1) //471738 1 power: Decrepify { Curses += (Curses == null ? "" : " ") + "D"; } if (Curses != null) { d += ((d != string.Empty)? " | ":"") + Curses; } } if (d != string.Empty) { LightFont.DrawText(LightFont.GetTextLayout(d), XPos + 65 + w2, y - py); } //Draw Rectangles BackgroundBrush.DrawRectangle(XPos, y, w2, h); BorderBrush.DrawRectangle(XPos, y, w2, h); cBrush.DrawRectangle(XPos, y, (float)w, h); LightFont.DrawText(per, XPos + 8 + w2, y - py); //Draw MonsterType if (ShowMonsterType) { var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized); cFont.DrawText(name, XPos + 3, y - py); } //increase linecount yref += 0.95f; }