Пример #1
0
        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();
        }
Пример #3
0
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)
                {
                    if (eliteGroup.ContainsKey(monster))
                    {
                        eliteGroup[monster] = monster.SnoMonster.Priority.ToString() + monster.SnoMonster.Sno + monster.SnoMonster.NameEnglish + String.Join(", ", monster.AffixSnoList);
                    }
                    else
                    {
                        eliteGroup.Add(monster, monster.SnoMonster.Priority.ToString() + monster.SnoMonster.Sno + monster.SnoMonster.NameEnglish + String.Join(", ", monster.AffixSnoList));
                    }
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);
            var    px     = Hud.Window.Size.Width * 0.00125f;
            var    py     = Hud.Window.Size.Height * 0.001667f;
            var    h      = py * 5;
            var    w2     = py * 50;
            var    count  = 0;
            string preStr = null;

            //remove clone
            foreach (var elite in eliteGroup1)
            {
                if (elite.Key.Illusion)
                {
                    continue;
                }
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    var x         = Hud.Window.Size.Width * 0.125f;
                    var w         = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;
                    var affixlist = "";
                    foreach (var Affix in elite.Key.AffixSnoList)
                    {
                        affixlist = affixlist + " " + Affix.NameLocalized;
                    }
                    var text   = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f1") + "% " + elite.Key.SnoMonster.NameLocalized + affixlist;
                    var layout = TextFont.GetTextLayout(text);
                    if (preStr != elite.Value || preStr == null)
                    {
                        count++;
                    }
                    var y = py * 8 * count;
                    if (elite.Key.Invulnerable)
                    {
                        BorderBrush.DrawRectangle(x, y, w2, h);
                    }
                    BackgroundBrush.DrawRectangle(x, y, w2, h);
                    TextFont.DrawText(layout, x + px + w2, y - py);
                    ChampionBrush.DrawRectangle(x, y, (float)w, h);
                    preStr = elite.Value;
                    count++;
                }
                if (elite.Key.Rarity == ActorRarity.Rare)
                {
                    var x         = Hud.Window.Size.Width * 0.125f;
                    var w         = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;
                    var affixlist = "";
                    foreach (var Affix in elite.Key.AffixSnoList)
                    {
                        affixlist = affixlist + " " + Affix.NameLocalized;
                    }
                    var text   = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f1") + "% " + elite.Key.SnoMonster.NameLocalized + affixlist;
                    var layout = TextFont.GetTextLayout(text);
                    if (preStr != elite.Value || preStr == null)
                    {
                        count++;
                    }
                    var y = py * 8 * count;
                    if (elite.Key.Invulnerable)
                    {
                        BorderBrush.DrawRectangle(x, y, w2, h);
                    }
                    BackgroundBrush.DrawRectangle(x, y, w2, h);
                    TextFont.DrawText(layout, x + px + w2, y - py);
                    RareBrush.DrawRectangle(x, y, (float)w, h);
                    preStr = elite.Value;
                    count++;
                }
            }
            eliteGroup.Clear();
            eliteGroup1.Clear();
        }
Пример #4
0
        public override void PaintWorld(WorldLayer layer)

        {
            var monsters = Hud.Game.AliveMonsters;

            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();



            foreach (var monster in monsters)

            {
                if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)

                {
                    eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                }
            }

            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);



            var px = Hud.Window.Size.Width * 0.00125f;

            var py = Hud.Window.Size.Height * 0.001667f;

            var h = py * 6;

            var w2 = py * 80;

            var count = 0;

            string preStr = null;

            //remove clone

            foreach (var elite in eliteGroup1)

            {
                if (elite.Key.Rarity == ActorRarity.Champion)

                {
                    var eliteCurMaxHealth = 0.0d;

                    var eliteMaxHealth = 0.0d;

                    bool illusionist = false;

                    int same = 0;

                    eliteCurMaxHealth = elite.Key.MaxHealth;

                    same = 0;

                    foreach (var monster2 in monsters)

                    {
                        if (eliteMaxHealth < monster2.MaxHealth && monster2.Rarity == ActorRarity.Champion)
                        {
                            eliteMaxHealth = monster2.MaxHealth;
                        }
                    }

                    foreach (var monster1 in monsters)

                    {
                        if (monster1.Rarity == ActorRarity.Champion)

                        {
                            if (eliteCurMaxHealth == monster1.MaxHealth)
                            {
                                same++;
                            }

                            if (same == 2)

                            {
                                illusionist = true;

                                break;
                            }
                        }
                    }

                    if (illusionist == false)

                    {
                        var w = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;

                        var text = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f0") + "%";

                        var layout = TextFont.GetTextLayout(text);

                        if (preStr != elite.Value || preStr == null)
                        {
                            count++;
                        }

                        var y = py * 8 * count;

                        //BorderBrush.DrawRectangle(x, y, 70, h);

                        BackgroundBrush.DrawRectangle(Hud.Window.Size.Width * 0.125f, y, w2, h);

                        TextFont.DrawText(layout, Hud.Window.Size.Width * 0.125f + px + w2, y - py);

                        ChampionBrush.DrawRectangle(Hud.Window.Size.Width * 0.125f, y, (float)w, h);

                        preStr = elite.Value;

                        count++;
                    }
                }

                if (elite.Key.Rarity == ActorRarity.Rare)

                {
                    var eliteCurMaxHealth = 0.0d;

                    var eliteMaxHealth = 0.0d;

                    bool illusionist = false;

                    int same = 0;

                    eliteCurMaxHealth = elite.Key.MaxHealth;

                    same = 0;

                    foreach (var monster2 in monsters)

                    {
                        if (eliteMaxHealth < monster2.MaxHealth && monster2.Rarity == ActorRarity.Rare)
                        {
                            eliteMaxHealth = monster2.MaxHealth;
                        }
                    }

                    foreach (var monster1 in monsters)

                    {
                        if (monster1.Rarity == ActorRarity.Rare)

                        {
                            if (eliteCurMaxHealth == monster1.MaxHealth)
                            {
                                same++;
                            }

                            if (same == 2)

                            {
                                illusionist = true;

                                break;
                            }
                        }
                    }

                    if (illusionist == false)

                    {
                        var w = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;

                        var text = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f0") + "%";

                        var layout = TextFont.GetTextLayout(text);

                        if (preStr != elite.Value || preStr == null)
                        {
                            count++;
                        }

                        var y = py * 8 * count;

                        //BorderBrush.DrawRectangle(x, y, 70, h);

                        BackgroundBrush.DrawRectangle(Hud.Window.Size.Width * 0.125f, y, w2, h);

                        TextFont.DrawText(layout, Hud.Window.Size.Width * 0.125f + px + w2, y - py);

                        RareBrush.DrawRectangle(Hud.Window.Size.Width * 0.125f, y, (float)w, h);

                        preStr = elite.Value;

                        count++;
                    }
                }
            }

            eliteGroup.Clear();
        }
Пример #5
0
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)
                {
                    eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);

            var    px     = Hud.Window.Size.Width * 0.00125f;
            var    py     = Hud.Window.Size.Height * 0.001667f;
            var    h      = py * 5;
            var    w2     = py * 50;
            var    count  = 0;
            string preStr = null;

            //remove clone
            foreach (var elite in eliteGroup1)
            {
                bool illusionist = false;
                if (elite.Key.SummonerAcdDynamicId == 0)
                {
                    illusionist = false;
                }
                else
                {
                    illusionist = true;
                }
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    if (illusionist == false)
                    {
                        var x      = Hud.Window.Size.Width * 0.125f;
                        var w      = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;
                        var text   = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f0") + "%";
                        var layout = TextFont.GetTextLayout(text);
                        if (preStr != elite.Value || preStr == null)
                        {
                            count++;
                        }
                        var y = py * 8 * count;
                        if (elite.Key.Invulnerable)
                        {
                            BorderBrush.DrawRectangle(x, y, w2, h);
                        }
                        BackgroundBrush.DrawRectangle(x, y, w2, h);
                        TextFont.DrawText(layout, x + px + w2, y - py);
                        ChampionBrush.DrawRectangle(x, y, (float)w, h);
                        preStr = elite.Value;
                        count++;
                    }
                }
                if (elite.Key.Rarity == ActorRarity.Rare)
                {
                    if (illusionist == false)
                    {
                        var x      = Hud.Window.Size.Width * 0.125f;
                        var w      = elite.Key.CurHealth * w2 / elite.Key.MaxHealth;
                        var text   = (elite.Key.CurHealth * 100 / elite.Key.MaxHealth).ToString("f0") + "%";
                        var layout = TextFont.GetTextLayout(text);
                        if (preStr != elite.Value || preStr == null)
                        {
                            count++;
                        }
                        var y = py * 8 * count;
                        if (elite.Key.Invulnerable)
                        {
                            BorderBrush.DrawRectangle(x, y, w2, h);
                        }
                        BackgroundBrush.DrawRectangle(x, y, w2, h);
                        TextFont.DrawText(layout, x + px + w2, y - py);
                        RareBrush.DrawRectangle(x, y, (float)w, h);
                        preStr = elite.Value;
                        count++;
                    }
                }
            }
            eliteGroup.Clear();
        }
Пример #6
0
        public void PaintWorld(WorldLayer layer)
        {
            if (Hud.Game.IsInTown)
            {
                return;
            }

            var             h             = 17;
            var             w1            = 35;
            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.RareMinion)
                    {
                        if (IlluSpawners.Contains(monster.SnoMonster.NameEnglish))
                        {
                            foreach (var snoMonsterAffix in monster.AffixSnoList)
                            {
                                if (snoMonsterAffix.Affix == MonsterAffix.Illusionist)
                                {
                                    monstersElite.Add(monster);
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            foreach (var monster in monstersElite)
            {
                var wint   = monster.CurHealth / monster.MaxHealth;
                var hptext = "";
                if ((wint < 0) || (wint > 1))
                {
                    wint = 1; hptext = "bug";
                }
                else
                {
                    hptext = ValueToString(wint * 100, ValueFormat.NormalNumberNoDecimal);
                }
                var w        = wint * w1;
                var layout   = TextFont.GetTextLayout(hptext);
                var monsterX = monster.FloorCoordinate.ToScreenCoordinate().X - w1 / 2;
                var monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y - py * 8;
                if (monsterY < 0)
                {
                    monsterY = monster.FloorCoordinate.ToScreenCoordinate().Y;
                }
                monsterY -= 15.0f;
                var ShieldingX = 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);

                RareBrush.DrawRectangle(monsterX, monsterY, (float)w, h);
                TextFont.DrawText(layout, hpX, buffY);
            }
        }