public void PaintWorld(WorldLayer layer) { var w1 = Hud.Window.Size.Width * 0.00333f * b; var textLocust = "虫群"; //"L" var layoutLocust = TextFontLocust.GetTextLayout(textLocust); var textHaunt = "蚀魂"; //"H" var layoutHaunt = TextFontHaunt.GetTextLayout(textHaunt); var h2 = Hud.Window.Size.Height * 0.017f; var x2 = Hud.Window.Size.Width * 0.001667f * b; var x3 = Hud.Window.Size.Width * 0.02f; var monsters = Hud.Game.AliveMonsters; foreach (var monster in monsters) { bool illusionist = false; if (monster.SummonerAcdDynamicId == 0) { illusionist = false; } else { illusionist = true; } if (monster.Rarity == ActorRarity.Champion) { if (illusionist == false) { var hptext = (monster.CurHealth * 100 / monster.MaxHealth).ToString("f0") + "%"; var layout = TextFont.GetTextLayout(hptext); var h = Hud.Window.Size.Height * 0.00034f * 35; var w = monster.CurHealth * w1 / monster.MaxHealth; var monsterX = monster.FloorCoordinate.ToScreenCoordinate().X; // - w1 / 2; var monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y; // + py * 14; var locustX = monsterX + x3 * 0.1f; var hauntX = monsterX - x3; var buffY = monsterY - h2 * 2f; var hpX = monsterX - 1.5f; if (monster.Invulnerable) { BorderBrush.DrawRectangle(monsterX - x2, monsterY + h2, w1, h); } BackgroundBrush.DrawRectangle(monsterX - x2, monsterY + h2, w1, h); if (monster.Rarity == ActorRarity.Champion) { ChampionBrush.DrawRectangle(monsterX - x2, monsterY + h2, (float)w, h); } if (monster.Locust) { TextFontLocust.DrawText(layoutLocust, locustX, buffY); } if (monster.Haunted) { TextFontHaunt.DrawText(layoutHaunt, hauntX, buffY); } TextFont.DrawText(layout, hpX, monsterY + h2 / 1.2f); } } if (monster.Rarity == ActorRarity.Rare) { if (illusionist == false) { var hptext = (monster.CurHealth * 100 / monster.MaxHealth).ToString("f0") + "%"; var layout = TextFont.GetTextLayout(hptext); var h = Hud.Window.Size.Height * 0.00034f * 35; var w = monster.CurHealth * w1 / monster.MaxHealth; var monsterX = monster.FloorCoordinate.ToScreenCoordinate().X; // - w1 / 2; var monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y; // + py * 14; var locustX = monsterX + x3 * 0.1f; var hauntX = monsterX - x3; var buffY = monsterY - h2 * 2f; var hpX = monsterX - 1.5f; if (monster.Invulnerable) { BorderBrush.DrawRectangle(monsterX - x2, monsterY + h2, w1, h); } BackgroundBrush.DrawRectangle(monsterX - x2, monsterY + h2, w1, h); if (monster.Rarity == ActorRarity.Rare) { RareBrush.DrawRectangle(monsterX - x2, monsterY + h2, (float)w, h); } if (monster.Locust) { TextFontLocust.DrawText(layoutLocust, locustX, buffY); } if (monster.Haunted) { TextFontHaunt.DrawText(layoutHaunt, hauntX, buffY); } TextFont.DrawText(layout, hpX, monsterY + h2 / 1.2f); } } } }
public void PaintWorld(WorldLayer layer) { var h = 17; var w1 = 30; var textLocust = "L"; var layoutLocust = TextFontLocust.GetTextLayout(textLocust); var textHaunt = "H"; var layoutHaunt = TextFontHaunt.GetTextLayout(textHaunt); var py = Hud.Window.Size.Height / 600; var monsters = Hud.Game.AliveMonsters.Where(x => x.IsAlive); List <IMonster> monstersElite = new List <IMonster>(); foreach (var monster in monsters) { if (monster.SummonerAcdDynamicId == 0) { if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare) { monstersElite.Add(monster); } } } foreach (var monster in monstersElite) { var hptext = ValueToString(monster.CurHealth * 100 / monster.MaxHealth, ValueFormat.NormalNumberNoDecimal); var layout = TextFont.GetTextLayout(hptext); var w = monster.CurHealth * w1 / monster.MaxHealth; var monsterX = monster.FloorCoordinate.ToScreenCoordinate().X - w1 / 2; var monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y + py * 12; var locustX = monsterX - w1 / 2; var hauntX = monsterX + w1 + 5; var buffY = monsterY - 1; var hpX = monsterX + 7; BorderBrush.DrawRectangle(monsterX, monsterY, w1, h); BackgroundBrush.DrawRectangle(monsterX, monsterY, w1, h); if (monster.Rarity == ActorRarity.Champion) { ChampionBrush.DrawRectangle(monsterX, monsterY, (float)w, h); } if (monster.Rarity == ActorRarity.Rare) { bool flagJ = false; foreach (var snoMonsterAffix in monster.AffixSnoList) { if (snoMonsterAffix.Affix == MonsterAffix.Juggernaut) { flagJ = true; break; } } if (flagJ) { RareJBrush.DrawRectangle(monsterX, monsterY, (float)w, h); } else { RareBrush.DrawRectangle(monsterX, monsterY, (float)w, h); } } if (monster.Locust) { TextFontLocust.DrawText(layoutLocust, locustX, buffY); } if (monster.Haunted) { TextFontHaunt.DrawText(layoutHaunt, hauntX, buffY); } TextFont.DrawText(layout, hpX, buffY); } monstersElite.Clear(); }