public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters.Where(x => x.IsElite))
            {
                if (HideOnIllusions)
                {
                    if (monster.Illusion)
                    {
                        continue;
                    }
                    // if (monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_0_Visual_Effect_None, 264185, 0) != 0) continue;
                }

                foreach (var snoMonsterAffix in monster.AffixSnoList)
                {
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out var decorator))
                    {
                        continue;
                    }

                    var affixName = CustomAffixNames.ContainsKey(snoMonsterAffix.Affix) ? CustomAffixNames[snoMonsterAffix.Affix] : snoMonsterAffix.NameLocalized;

                    decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                }
            }
        }
Beispiel #2
0
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters.Where(x => x.IsElite))
            {
                if (HideOnIllusions && (monster.SummonerAcdDynamicId != 0) && (monster.Rarity == ActorRarity.RareMinion))
                {
                    continue;
                }

                foreach (var snoMonsterAffix in monster.AffixSnoList)
                {
                    WorldDecoratorCollection decorator;
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                    {
                        continue;
                    }

                    string affixName = null;
                    if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                    {
                        affixName = CustomAffixNames[snoMonsterAffix.Affix];
                    }
                    else
                    {
                        affixName = snoMonsterAffix.NameLocalized;
                    }

                    decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                }
            }
        }
Beispiel #3
0
        public override void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                foreach (var snoMonsterAffix in monster.AffixSnoList)
                {
                    WorldDecoratorCollection decorator;
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                    {
                        continue;
                    }

                    string affixName = null;
                    if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                    {
                        affixName = CustomAffixNames[snoMonsterAffix.Affix];
                    }
                    else
                    {
                        affixName = snoMonsterAffix.NameLocalized;
                    }

                    decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                }
            }
        }
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                if (monster.Rarity != ActorRarity.Champion && monster.Rarity != ActorRarity.Rare)
                {
                    continue;
                }
                if (monster.SummonerAcdDynamicId != 0)
                {
                    continue;
                }

                if (layer == WorldLayer.Ground)
                {
                    var hpValue = (monster.CurHealth * 100 / monster.MaxHealth).ToString("f0") + "%"; // code for HP - working, but not as intended
                    EliteHealthDecorator.Paint(monster, monster.FloorCoordinate, hpValue);            // code for HP - working, but not as intended
                }

                foreach (var snoMonsterAffix in monster.AffixSnoList)
                {
                    WorldDecoratorCollection decorator;
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                    {
                        continue;
                    }

                    string affixName = null;
                    if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                    {
                        affixName = CustomAffixNames[snoMonsterAffix.Affix];
                    }
                    else
                    {
                        affixName = snoMonsterAffix.NameLocalized;
                    }

                    decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                }
            }
        }
Beispiel #5
0
        public void PaintWorld(WorldLayer layer)
        {
            if (layer != WorldLayer.Ground)
            {
                return;
            }

            var packs = Hud.Game.MonsterPacks;

            if (!packs.Any())
            {
                return;
            }

            var padding = 6.0f * Hud.Window.Size.Height / 1200f;

            var maxHealth       = packs.Max(pack => pack.MonstersAlive.Any() ? pack.MonstersAlive.Max(monster => monster.MaxHealth) : 0);
            var middleBarHeight = Hud.Window.Size.Height * MiddleHealthBarHeight;
            var middleBarWidth  = Hud.Window.Size.Width * MiddleHealthBarWidth;

            foreach (var pack in packs)
            {
                var alive = !HideOnIllusions?pack.MonstersAlive.ToList() : pack.MonstersAlive.Where(x => (x.SummonerAcdDynamicId == 0) || (x.Rarity != ActorRarity.RareMinion)).ToList();

                if (alive.Count == 0)
                {
                    continue;
                }

                alive.Sort((a, b) =>
                {
                    var r = a.Rarity.CompareTo(b.Rarity);
                    if (r == 0)
                    {
                        r = -a.MaxHealth.CompareTo(b.MaxHealth);
                    }
                    return(r);
                });

                var center = Hud.Window.CreateWorldCoordinate(0, 0, 0);

                var n = 0;
                if (alive.Any(x => x.FloorCoordinate.IsOnScreen()))
                {
                    foreach (var monster in alive.Where(x => x.FloorCoordinate.IsOnScreen()))
                    {
                        center.Add(monster.FloorCoordinate);
                        n++;
                    }
                }
                else
                {
                    foreach (var monster in alive)
                    {
                        center.Add(monster.FloorCoordinate);
                        n++;
                    }
                }
                center.Set(center.X / n, center.Y / n, center.Z / n);

                var centerScreenCoordinate = center.ToScreenCoordinate(false);

                var y = centerScreenCoordinate.Y;

                if (pack.IsFullChampionPack)
                {
                    if (ChampionPackLineBrush != null && (alive.Count > 1))
                    {
                        PaintFloorLines(alive, ChampionPackLineBrush);
                    }
                    if (ChampionPackNameFont != null)
                    {
                        var layout = ChampionPackNameFont.GetTextLayout(pack.LeadSnoMonster.NameLocalized);
                        ChampionPackNameFont.DrawText(layout, centerScreenCoordinate.X - layout.Metrics.Width / 2, y);
                        y += layout.Metrics.Height + padding;
                    }
                }
                else
                {
                    if (RarePackLineBrush != null && (alive.Count > 1))
                    {
                        PaintFloorLines(alive, RarePackLineBrush);
                    }
                    if (RarePackNameFont != null)
                    {
                        var layout = RarePackNameFont.GetTextLayout(pack.LeadSnoMonster.NameLocalized);
                        RarePackNameFont.DrawText(layout, centerScreenCoordinate.X - layout.Metrics.Width / 2, y);
                        y += layout.Metrics.Height + padding;
                    }
                }

                var decoHeight = 0.0f;

                var snoMonsterAffixList = pack.AffixSnoList.ToList();
                snoMonsterAffixList.Sort((a, b) => - Priorities[a.Affix].CompareTo(Priorities[b.Affix]));

                foreach (var snoMonsterAffix in snoMonsterAffixList)
                {
                    GroundLabelDecorator decorator;
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                    {
                        continue;
                    }

                    string affixName = null;
                    if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                    {
                        affixName = CustomAffixNames[snoMonsterAffix.Affix];
                    }
                    else
                    {
                        affixName = snoMonsterAffix.NameLocalized;
                    }

                    if (decoHeight == 0.0f)
                    {
                        decoHeight = decorator.TextFont.GetTextLayout(affixName).Metrics.Height * 1.2f;
                    }

                    decorator.OffsetY = y - centerScreenCoordinate.Y;

                    decorator.Paint(null, center, affixName);
                }

                y += decoHeight + padding / 2;

                foreach (var monster in alive)
                {
                    var curW = (float)(middleBarWidth / maxHealth * monster.CurHealth);
                    var maxW = (float)(middleBarWidth / maxHealth * monster.MaxHealth);

                    HealthBackgroundMax.DrawRectangleGridFit(centerScreenCoordinate.X - maxW / 2, y, maxW, middleBarHeight);
                    switch (monster.Rarity)
                    {
                    case ActorRarity.Champion:
                        HealthBackgroundChampionRemaining.DrawRectangleGridFit(centerScreenCoordinate.X - maxW / 2, y, curW, middleBarHeight);
                        break;

                    case ActorRarity.Rare:
                        HealthBackgroundRareRemaining.DrawRectangleGridFit(centerScreenCoordinate.X - maxW / 2, y, curW, middleBarHeight);
                        break;

                    case ActorRarity.RareMinion:
                        HealthBackgroundRareMinionRemaining.DrawRectangleGridFit(centerScreenCoordinate.X - maxW / 2, y, curW, middleBarHeight);
                        break;
                    }

                    HealthBorder.DrawRectangleGridFit(centerScreenCoordinate.X - maxW / 2, y, maxW, middleBarHeight);

                    y += middleBarHeight;
                }
            }
        }
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters;
            var goblins  = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);

            foreach (var monster in goblins)
            {
                GoblinDecorator.Paint(layer, monster, monster.FloorCoordinate, null);
            }

            List <IMonster> monstersElite = new List <IMonster>();

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)
                {
                    monstersElite.Add(monster);
                }

                if (monster.Rarity == ActorRarity.RareMinion)
                {
                    // RareMinionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.Unique)
                {
                    UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.Boss)
                {
                    BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }
            }
            foreach (var monster in monstersElite)
            {
                if (monster.SummonerAcdDynamicId == 0)
                {
                    bool flag = true;
                    foreach (var snoMonsterAffix in monster.AffixSnoList)
                    {
                        string affixName = null;
                        if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                        {
                            affixName = CustomAffixNames[snoMonsterAffix.Affix];
                        }
                        else
                        {
                            affixName = snoMonsterAffix.NameLocalized;
                        }
                        if (snoMonsterAffix.Affix == MonsterAffix.Juggernaut)
                        {
                            flag = false;
                        }

                        WorldDecoratorCollection decorator;
                        if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                        {
                            continue;
                        }
                        decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                    }
                    if (monster.Rarity == ActorRarity.Rare)
                    {
                        if (flag)
                        {
                            RareDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                        else
                        {
                            JuggernautDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                    }
                    if (monster.Rarity == ActorRarity.Champion)
                    {
                        ChampionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                    }
                }
            }

            monstersElite.Clear();
        }
Beispiel #7
0
        public void PaintWorld(WorldLayer layer)
        {
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
            {
                return;
            }
            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.Normal || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                {
                    foreach (var snoMonsterAffix in monster.AffixSnoList)
                    {
                        WorldDecoratorCollection decorator;
                        if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                        {
                            continue;
                        }

                        string affixName = null;
                        if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                        {
                            affixName = CustomAffixNames[snoMonsterAffix.Affix];
                        }
                        else
                        {
                            affixName = snoMonsterAffix.NameLocalized;
                        }

                        decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                    }
                }

                if (monster.Rarity == ActorRarity.Champion)
                {
                    if (illusionist == false)
                    {
                        foreach (var snoMonsterAffix in monster.AffixSnoList)
                        {
                            WorldDecoratorCollection decorator;
                            if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                            {
                                continue;
                            }

                            string affixName = null;
                            if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                            {
                                affixName = CustomAffixNames[snoMonsterAffix.Affix];
                            }
                            else
                            {
                                affixName = snoMonsterAffix.NameLocalized;
                            }

                            decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                    }
                }
                if (monster.Rarity == ActorRarity.Rare)
                {
                    if (illusionist == false)
                    {
                        foreach (var snoMonsterAffix in monster.AffixSnoList)
                        {
                            WorldDecoratorCollection decorator;
                            if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                            {
                                continue;
                            }

                            string affixName = null;
                            if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                            {
                                affixName = CustomAffixNames[snoMonsterAffix.Affix];
                            }
                            else
                            {
                                affixName = snoMonsterAffix.NameLocalized;
                            }

                            decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                    }
                }
                if (monster.Rarity == ActorRarity.RareMinion)
                {
                    if (illusionist == false)
                    {
                        if (MinionType == 0)
                        {
                            continue;
                        }
                        if (MinionType == 1)
                        {
                            string affixName = "爪牙";
                            MinionDecorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                        if (MinionType == 2)
                        {
                            foreach (var snoMonsterAffix in monster.AffixSnoList)
                            {
                                WorldDecoratorCollection decorator;
                                if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                                {
                                    continue;
                                }

                                string affixName = null;
                                if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                                {
                                    affixName = CustomAffixNames[snoMonsterAffix.Affix];
                                }
                                else
                                {
                                    affixName = snoMonsterAffix.NameLocalized;
                                }

                                decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                            }
                        }
                    }
                }
            }
        }