private void DrawPack(WorldLayer layer, IMonsterPack p, ref float yref) { //Check if any affixes are wished to be displayed if (DisplayAffix.Any()) { string dAffix = ""; foreach (ISnoMonsterAffix afx in p.AffixSnoList) //iterate affix list { if (DisplayAffix.Keys.Contains(afx.Affix)) //if affix is an key { dAffix += DisplayAffix[afx.Affix] + " "; //add to output } } if (!string.IsNullOrEmpty(dAffix)) { var d = LightFont.GetTextLayout(dAffix); var y = YPos + py * 8 * yref; LightFont.DrawText(d, XPos, y - py); yref += 1.0f; } } //iterate all alive monsters of pack and print healthbars foreach (IMonster m in p.MonstersAlive) { DrawHealthBar(layer, m, ref yref); } }
private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref) { 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; } //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 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; }
private float AfijosColores(MonsterAffix afijo, float coordx, float coordy) { ColorA = null; switch (afijo) { case MonsterAffix.Frozen: ColorA = AzulFFontA; break; case MonsterAffix.FrozenPulse: ColorA = Azul1; break; case MonsterAffix.Wormhole: ColorA = RojoFontA; break; case MonsterAffix.Illusionist: ColorA = VerdeCFontA; break; case MonsterAffix.Juggernaut: ColorA = JugFontA; break; case MonsterAffix.Waller: ColorA = MarronFontA; break; case MonsterAffix.Arcane: ColorA = MoradoFontA; break; case MonsterAffix.HealthLink: ColorA = AzulFontA; break; case MonsterAffix.Thunderstorm: ColorA = AmarilloFontA; break; case MonsterAffix.Shielding: ColorA = GrisFontA; break; case MonsterAffix.Desecrator: ColorA = Rosa1; break; case MonsterAffix.Molten: ColorA = Red1; break; case MonsterAffix.FireChains: ColorA = Red2; break; case MonsterAffix.Teleporter: ColorA = TeleportFontA; break; case MonsterAffix.Mortar: ColorA = GrisFontA; break; case MonsterAffix.Poison: ColorA = Verde2; break; case MonsterAffix.Plagued: ColorA = Verde1; break; case MonsterAffix.Horde: ColorA = HordaFontA; break; case MonsterAffix.Electrified: ColorA = Amarelo1; break; default: ColorA = LightFont; break; } var d = ColorA.GetTextLayout(DisplayAffix[afijo]); ColorA.DrawText(d, coordx, coordy); return(coordx + LightFont.GetTextLayout("-").Metrics.Width + d.Metrics.Width); }