Exemplo n.º 1
0
		public void AddDrawingLayer(WorldLayer layer)
		{
			if(layer.Id == Entity?.Layer)
				throw new ArgumentException("Can't add draw layer to camera which is equal to it's own layer");

			_layerMask |= layer.Id;
		}
Exemplo n.º 2
0
		public override void Fill(MapBlock _block, WorldLayer _layer)
		{
			base.Fill(_block, _layer);

            //var innerPerimeter = Room.RoomRectangle.Inflate(-1, -1);
            //var indoor = InDoorWorldCoords.Select(BaseMapBlock.GetInBlockCoords);
            //var doorCoords = BaseMapBlock.GetInBlockCoords(DoorWorldCoords);

            //var corners = innerPerimeter.CornerPoints.Except(indoor).OrderBy(_point => _point.GetDistTill(doorCoords)).ToArray();
            //var allPoints = innerPerimeter.BorderPoints.Except(corners).Except(indoor).OrderByDescending(_point => _point.GetDistTill(doorCoords)).ToArray();

            //var cornerTiles = new[] {ETileset.NONE, ETileset.NONE, ETileset.CHAIR, ETileset.BARREL}.OrderBy(_tiles => World.Rnd.Next()).ToArray();
            //var perimeterTiles = new[] {ETileset.NONE, ETileset.CHEST, ETileset.WEAPON_RACK, ETileset.ARMOR_RACK, ETileset.CABINET}.OrderBy(_tiles => World.Rnd.Next()).ToArray();
            //BedCoords = allPoints[0];
            //_block.AddObject(ETileset.BED.GetThing(), BedCoords);
            //for (var index = 1; index < allPoints.Length; index++)
            //{
            //    var point = allPoints[index];
            //    var tile = perimeterTiles[index%perimeterTiles.Length];
            //    if (tile != ETileset.NONE)
            //    {
            //        _block.AddObject(tile.GetThing(), point);
            //    }
            //}

            //for (var index = 0; index < corners.Length; index++)
            //{
            //    var point = corners[index];
            //    var tile = cornerTiles[index%cornerTiles.Length];
            //    if (tile != ETileset.NONE)
            //    {
            //        _block.AddObject(tile.GetThing(), point);
            //    }
            //}
		}
Exemplo n.º 3
0
		public override void Fill(MapBlock _block, WorldLayer _layer)
		{
			var rnd = new Random(_block.RandomSeed);

			InDoorWorldCoords = Room.RoomRectangle.Inflate(-1, -1).BorderPoints.ToArray();
			OutDoorWorldCoords = Room.RoomRectangle.BorderPoints.ToArray();

			MapBlockHelper.Fill(_block, rnd, _layer, _layer.DefaultEmptySpaces, Room.AreaRectangle);

		    var graves = EssenceHelper.GetAllThings<Grave>().ToArray();

			foreach (var point in Room.RoomRectangle.AllPoints)
			{
				if (rnd.Next(4) == 0 && !InDoorWorldCoords.Contains(point))
				{
					_block.AddEssence(graves.RandomItem(rnd), point);
				}
			}
		}
Exemplo n.º 4
0
		public virtual void Fill(MapBlock _block, WorldLayer _layer)
		{
			var mapBlock = _block;
			var roomRectangle = Room.RoomRectangle;

			var wall = Walls.ToArray().RandomItem(World.Rnd);
			var floor = Floors.ToArray().RandomItem(World.Rnd);

			foreach (var point in roomRectangle.AllPoints)
			{
				mapBlock.Map[point.X, point.Y] = floor;
			}

			var borderPoints = roomRectangle.BorderPoints.ToArray();
			var cornerPoints = roomRectangle.CornerPoints;
			var i = 0;
			foreach (var point in borderPoints)
			{
				if (cornerPoints.Contains(point))
				{
					mapBlock.Map[point.X, point.Y] = wall.Item1;
				}
				else
				{
					if (i++%3 == 0)
					{
						mapBlock.Map[point.X, point.Y] = wall.Item2;
					}
					else
					{
						mapBlock.Map[point.X, point.Y] = wall.Item1;
					}
				}
			}

			CreateDoor(mapBlock, floor, borderPoints);

			mapBlock.AddEssence(new IndoorLight(new LightSource(10, new FColor(3f, 1f, 1f, 0.5f)), EssenceHelper.GetFirstFoundedMaterial<MetalMaterial>()), roomRectangle.Inflate(-1, -1).Random(World.Rnd));
		}
Exemplo n.º 5
0
        public void PaintWorld(WorldLayer layer)
        {
            var items = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor);

            foreach (var item in items)
            {
                var inSet = Hud.Game.Me.ArmorySets.Any(set => set.ContainsItem(item));
                if (inSet)
                {
                    InArmorySetDecorator.Paint(layer, item, item.FloorCoordinate, Hud.Game.Me.ArmorySets.First(set => set.ContainsItem(item)).Name);
                    continue;
                }

                var legendaryDisplayed = false;
                if (item.IsLegendary && item.Unidentified && (item.SnoItem.Kind != ItemKind.craft))
                {
                    legendaryDisplayed = true;
                    if (item.SetSno != uint.MaxValue)
                    {
                        switch (item.AncientRank)
                        {
                        case 1:
                            AncientSetDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;

                        case 2:
                            PrimalSetDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;

                        default:
                            SetDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;
                        }
                    }
                    else
                    {
                        switch (item.AncientRank)
                        {
                        case 1:
                            AncientDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;

                        case 2:
                            PrimalDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;

                        default:
                            LegendaryDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                            break;
                        }
                    }
                }

                if (item.SnoItem.HasGroupCode("uber") || item.SnoItem.HasGroupCode("riftkeystone"))
                {
                    UtilityDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                }

                if (item.SnoItem.Sno == 2087837753)
                {
                    DeathsBreathDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                    continue;
                }

                if (item.IsNormal && (item.KeepDecision == ItemKeepDecision.LooksGood))
                {
                    NormalKeepDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                }
                else if (item.IsMagic && (item.KeepDecision == ItemKeepDecision.LooksGood))
                {
                    MagicKeepDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                }
                else if (item.IsRare && (item.KeepDecision == ItemKeepDecision.LooksGood))
                {
                    RareKeepDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                }
                else if (item.IsLegendary && (item.KeepDecision == ItemKeepDecision.LooksGood) && !legendaryDisplayed)
                {
                    LegendaryKeepDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                }

                if (!Hud.Game.IsInTown)
                {
                    if (item.SnoItem.Kind == ItemKind.book)
                    {
                        BookDecorator.Paint(layer, item, item.FloorCoordinate, GetItemName(item));
                    }
                }
            }
        }
Exemplo n.º 6
0
        public void PaintWorld(WorldLayer layer)
        {
            DistYards = 0;
            var firstQuestMarker = true;
            var actors           = Hud.Game.Actors.Where(a => _actorList.Contains(a.SnoActor.Sno));

            foreach (var Actor in actors)
            {
                if (Actor == null)
                {
                    continue;
                }
                if (Actor.FloorCoordinate == null)
                {
                    continue;
                }
                if (Actor.IsDisabled || Actor.IsOperated)
                {
                    continue;
                }

                uint   ThatQuest = 0;
                string Name      = string.Empty;
                switch (Actor.SnoActor.Sno)
                {
                case ActorSnoEnum._px_spidercaves_camp_cocoon /*432770*/: Name = "Royal Cocoon"; ThatQuest = 432784; break;

                case ActorSnoEnum._px_wilderness_camp_templarprisoners /*430733*/: Name = "Captured Villager"; ThatQuest = 430723; break;

                case ActorSnoEnum._a2dun_zolt_ibstone_a_portalroulette_mini /*432885*/: Name = "Ancient Device"; ThatQuest = 433025; break;

                case ActorSnoEnum._px_caout_cage_bountycamp /*433051*/: Name = "Caldeum Villager"; ThatQuest = 433053; break;

                case ActorSnoEnum._px_ruins_frost_camp_cage /*435703*/: Name = "Captured Barbarian"; ThatQuest = 436280; break;

                case ActorSnoEnum._px_highlands_camp_resurgentcult_totem /*432259*/: Name = "Triune Monument"; ThatQuest = 432293; break;

                case ActorSnoEnum._px_bounty_death_orb_little /*433246*/: Name = "Death Orb"; ThatQuest = 433256; break;

                case ActorSnoEnum._px_bounty_ramparts_camp_switch /*433385*/: Name = "Catapult Winch"; ThatQuest = 433392; break;

                case ActorSnoEnum._px_bounty_camp_azmodan_fight_spawner /*433295*/: Name = "Demon Gate"; ThatQuest = 433309; break;

                case ActorSnoEnum._x1_westm_necro_jar_of_souls_camp_graveyard /*433316*/: Name = "Death Prison"; ThatQuest = 433339; break;

                case ActorSnoEnum._px_leorics_camp_worthammilitia_ex /*434366*/: Name = "Tortured Wortham Militia"; ThatQuest = 434378; break;

                case ActorSnoEnum._px_bridge_camp_lostpatrol /*433184*/: Name = "Captured Guard"; ThatQuest = 433217; break;

                case ActorSnoEnum._px_bounty_camp_trappedangels /*433124*/: Name = "Bone Cage"; ThatQuest = 433099; break;

                case ActorSnoEnum._px_bounty_camp_hellportals_frame /*433402*/: Name = "Hell Portal"; ThatQuest = 433422; break;

                case ActorSnoEnum._px_oasis_camp_ironwolves /*432331*/: Name = "Captured Iron Wolf"; ThatQuest = 432334; break;

                default: Name = string.Empty; break;
                }
                var quest = Hud.Game.Bounties.FirstOrDefault(x => x.SnoQuest.Sno == ThatQuest);
                if ((quest != null) && quest.State != QuestState.completed)
                {
                    QuestDecorator.Paint(layer, null, Actor.FloorCoordinate, Name);
                    firstQuestMarker = false;
                }
            }

            // Pools of reflection
            if (Pools)
            {
                var PoolsOfReflection = Hud.Game.Shrines.Where(p => !p.IsDisabled && !p.IsOperated && p.Type == ShrineType.PoolOfReflection);

                foreach (var PoolOfReflection in PoolsOfReflection)
                {
                    PoolDecorator.Paint(layer, null, PoolOfReflection.FloorCoordinate, PoolOfReflection.SnoActor.NameLocalized);
                }
            }

            // modified Xenthalon's AdvancedMarkerPlugin
            var markers = Hud.Game.Markers.OrderBy(i => Hud.Game.Me.FloorCoordinate.XYDistanceTo(i.FloorCoordinate));

            if (markers != null)
            {
                foreach (var marker in markers)
                {
                    if (marker == null)
                    {
                        continue;
                    }
                    if (marker.FloorCoordinate == null)
                    {
                        continue;
                    }
                    if (marker.Name == null)
                    {
                        continue;
                    }

                    var OnScreen = marker.FloorCoordinate.IsOnScreen(1);
                    QuestDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen); // do not display ground labels when the marker is on the screen
                    KeywardenDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);
                    BossDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);

                    if (marker.SnoQuest != null && firstQuestMarker)
                    {
                        DistYards = (int)(marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate));
                        QuestDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        firstQuestMarker = false;
                    }
                    else if (marker.SnoActor != null)
                    {
                        if (marker.SnoActor.Code.Contains("_Boss_"))
                        {
                            BossDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                        else if (marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) < 500)
                        {
                            KeywardenDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                    }
                }
            }

            if (Hud.Game.NumberOfPlayersInGame == 1)
            {
                NameOther3 = string.Empty; Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty;
                NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty;
                NameOther1 = string.Empty; Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther1 = string.Empty;
                return;
            }

            // Strengh in numbers buff indicator
            var SiNBuff      = Hud.Game.Me.Powers.GetBuff(258199);
            int StrengthBuff = SiNBuff.IconCounts[0] * 10;

            if (StrengthBuff != 0 && !Hud.Game.Me.IsDead)
            {
                StrengthBuffText = "+" + StrengthBuff + "%";
                var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.BoostWrapper.BoostsDifficultyStackPanel.clock").Rectangle;
                if (Hud.Game.Me.Hero.Seasonal)
                {
                    StrengthBuffDecorator.Paint(uiRect.Left - uiRect.Width * 1.14f, uiRect.Top + uiRect.Height * 1f, uiRect.Width, uiRect.Height, HorizontalAlign.Right);
                }
                else
                {
                    StrengthBuffDecorator.Paint(uiRect.Left - uiRect.Width * 0.96f, uiRect.Top + uiRect.Height * 1f, uiRect.Width, uiRect.Height, HorizontalAlign.Right);
                }
            }

            // Thread between players
            var players = Hud.Game.Players.Where(player => !player.IsMe).OrderBy(player => player.PortraitIndex);

            if (players != null)
            {
                foreach (var player in players)
                {
                    if (player == null)
                    {
                        continue;
                    }
                    else if (player.BattleTagAbovePortrait == null)
                    {
                        continue;
                    }
                    else if (player.FloorCoordinate == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea.NameEnglish == null)
                    {
                        continue;
                    }
                    else if (double.IsNaN(player.NormalizedXyDistanceToMe))
                    {
                        continue;
                    }
                    else if (player.PortraitIndex == 1)
                    {
                        NameOther1 = player.BattleTagAbovePortrait; RealOther1 = player.FloorCoordinate; AreaOther1 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 2)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty; NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other1 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                    else if (player.PortraitIndex == 2)
                    {
                        NameOther2 = player.BattleTagAbovePortrait; RealOther2 = player.FloorCoordinate; AreaOther2 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 3)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other2 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                    else if (player.PortraitIndex == 3)
                    {
                        NameOther3 = player.BattleTagAbovePortrait; RealOther3 = player.FloorCoordinate; AreaOther3 = player.SnoArea.NameEnglish;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other3 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                }
            }

            Hud.Render.GetMinimapCoordinates(Other1.X, Other1.Y, out float Other1OnMapX, out float Other1OnMapY);
            Hud.Render.GetMinimapCoordinates(Other2.X, Other2.Y, out float Other2OnMapX, out float Other2OnMapY);
            Hud.Render.GetMinimapCoordinates(Other3.X, Other3.Y, out float Other3OnMapX, out float Other3OnMapY);

            if (!Hud.Game.IsInTown && ThreadBetweenPlayers)
            {
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other2OnMapX, Other2OnMapY);
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other3OnMapX, Other3OnMapY);
                WhiteBrush.DrawLine(Other3OnMapX, Other3OnMapY, Other2OnMapX, Other2OnMapY);
            }

            // banners
            var banners = Hud.Game.Banners;

            if (banners != null)
            {
                foreach (var banner in banners)
                {
                    if (banner == null || banner.FloorCoordinate == null || !banner.FloorCoordinate.IsValid)
                    {
                        continue;
                    }
                    if (!BannersList.ContainsKey(banner.FloorCoordinate))
                    {
                        BannersList.Add(banner.FloorCoordinate, Hud.Game.CurrentRealTimeMilliseconds);
                    }
                }
            }

            float DistOther1;
            float DistOther2;
            float DistOther3;
            float ZDistOther1;
            float ZDistOther2;
            float ZDistOther3;
            float DistMe;
            float ZDistMe;

            if (BannersList != null)
            {
                foreach (var ListedBanner in BannersList.Where(b => Hud.Game.CurrentRealTimeMilliseconds < b.Value + 30000).OrderBy(b => b.Value).Take(5))
                {
                    var    BanCoord  = ListedBanner.Key;
                    long   Timeleft  = ((ListedBanner.Value + (BannerTimeSeconds * 1000) - Hud.Game.CurrentRealTimeMilliseconds) / 1000);
                    string Countdown = " " + Timeleft.ToString("f0") + "s";

                    var onScreen = BanCoord.IsOnScreen();
                    if (onScreen)
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(false);
                    }
                    else
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(true);
                    }

                    if (RealOther1 != null && Hud.Game.NumberOfPlayersInGame >= 2)
                    {
                        DistOther1 = RealOther1.XYDistanceTo(BanCoord); ZDistOther1 = RealOther1.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther1 = float.MaxValue; ZDistOther1 = float.MaxValue;
                    }
                    if (RealOther2 != null && Hud.Game.NumberOfPlayersInGame >= 3)
                    {
                        DistOther2 = RealOther2.XYDistanceTo(BanCoord); ZDistOther2 = RealOther2.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther2 = float.MaxValue; ZDistOther2 = float.MaxValue;
                    }
                    if (RealOther3 != null && Hud.Game.NumberOfPlayersInGame == 4)
                    {
                        DistOther3 = RealOther3.XYDistanceTo(BanCoord); ZDistOther3 = RealOther3.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther3 = float.MaxValue; ZDistOther3 = float.MaxValue;
                    }
                    DistMe  = Hud.Game.Me.FloorCoordinate.XYDistanceTo(BanCoord);
                    ZDistMe = Hud.Game.Me.FloorCoordinate.ZDiffTo(BanCoord);

                    string NearestPlayer = string.Empty;
                    string BannerArea    = string.Empty;

                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1; BannerArea = AreaOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2; BannerArea = AreaOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3; BannerArea = AreaOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner"; BannerArea = Hud.Game.Me.SnoArea.NameEnglish;
                        }
                    }
                    else
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && BannersAreas[BanCoord] == AreaOther1 && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && BannersAreas[BanCoord] == AreaOther2 && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && BannersAreas[BanCoord] == AreaOther3 && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner";
                        }
                    }

                    string RealBannerArea = string.Empty;
                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        BannersAreas.Add(BanCoord, BannerArea);
                    }
                    else
                    {
                        RealBannerArea = BannersAreas[BanCoord];
                    }
                    bool SameArea = false;
                    if (Hud.Game.Me.SnoArea.NameEnglish == RealBannerArea)
                    {
                        SameArea = true;
                    }
                    else
                    {
                        SameArea = false;
                    }
                    if (!SameArea || Hud.Game.Me.IsInTown)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(false);
                    }
                    else if (SameArea)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(true);
                    }

                    if (NearestPlayer == "banner near ")
                    {
                        NearestPlayer = "banner";
                    }
                    if (RealBannerArea.Contains("[TEMP]"))
                    {
                        RealBannerArea = RealBannerArea.Replace("[TEMP]", string.Empty).Trim();
                    }
                    if (RealBannerArea.Contains("Loot Run"))
                    {
                        RealBannerArea = RealBannerArea.Replace("Loot Run", "Rift").Trim();
                    }

                    if (NearestPlayer != null && RealBannerArea != string.Empty)
                    {
                        if (SameArea)
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + Countdown);
                        }
                        else if (NearestPlayer != "banner")
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Environment.NewLine + "teleport!" + Countdown);
                        }
                        else
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Countdown);
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!Hud.Game.IsInTown)
            {
                return;
            }
            if (Hud.Inventory.InventoryMainUiElement.Visible)
            {
                return;
            }
            var    Sellers       = Hud.Game.Actors.Where(x => _actorList.Contains(x.SnoActor.Sno));
            string SellerMessage = string.Empty;
            int    Seconds       = Hud.Time.Now.Second;

            if (Seconds % 5 == 0 && PrevSeconds != Seconds)
            {
                KadalaSentence++;
                if (KadalaSentence == 5)
                {
                    KadalaSentence = 0;
                }
                JewellerSentence++;
                if (JewellerSentence == 4)
                {
                    JewellerSentence = 0;
                }
                MysticSentence++;
                if (MysticSentence == 5)
                {
                    MysticSentence = 0;
                }
                BlackSmithSentence++;
                if (BlackSmithSentence == 3)
                {
                    BlackSmithSentence = 0;
                }
                KulleSentence++;
                if (KulleSentence == 6)
                {
                    KulleSentence = 0;
                }
                PrevSeconds = Seconds;
            }

            Dictionary <string, long> GemsCount = new Dictionary <string, long>();

            var GemsStash = Hud.Inventory.ItemsInStash.Where(x => x.SnoItem.MainGroupCode == "gems");

            foreach (var Gem in GemsStash)
            {
                if (Gem == null)
                {
                    continue;
                }
                if (Gem.SnoItem == null)
                {
                    continue;
                }
                if (Gem.SnoItem.NameEnglish == null)
                {
                    continue;
                }

                string GemNameStash     = Gem.SnoItem.NameEnglish;
                long   GemQuantityStash = Gem.Quantity;

                if (!GemsCount.ContainsKey(GemNameStash))
                {
                    GemsCount.Add(GemNameStash, GemQuantityStash);
                }
                else
                {
                    long DictQuantity = 0;
                    if (GemsCount.TryGetValue(GemNameStash, out DictQuantity))
                    {
                        GemsCount.TryGetValue(GemNameStash, out DictQuantity);
                        GemsCount[GemNameStash] = DictQuantity + GemQuantityStash;
                    }
                }
            }

            var GemsInventory = Hud.Inventory.ItemsInInventory.Where(x => x.SnoItem.MainGroupCode == "gems");

            foreach (var Gem in GemsInventory)
            {
                if (Gem == null)
                {
                    continue;
                }
                if (Gem.SnoItem == null)
                {
                    continue;
                }
                if (Gem.SnoItem.NameEnglish == null)
                {
                    continue;
                }

                string GemNameInventory     = Gem.SnoItem.NameEnglish;
                long   GemQuantityInventory = Gem.Quantity;

                if (!GemsCount.ContainsKey(GemNameInventory))
                {
                    GemsCount.Add(GemNameInventory, GemQuantityInventory);
                }
                else
                {
                    long DictQuantity2 = 0;
                    if (GemsCount.TryGetValue(GemNameInventory, out DictQuantity2))
                    {
                        GemsCount.TryGetValue(GemNameInventory, out DictQuantity2);
                        GemsCount[GemNameInventory] = DictQuantity2 + GemQuantityInventory;
                    }
                }
            }

            long Khanduran     = Hud.Game.Me.Materials.KhanduranRune;
            long Caldeum       = Hud.Game.Me.Materials.CaldeumNightShade;
            long Arreat        = Hud.Game.Me.Materials.ArreatWarTapestry;
            long AngelFlesh    = Hud.Game.Me.Materials.CorruptedAngelFlesh;
            long HolyWater     = Hud.Game.Me.Materials.WestmarchHolyWater;
            long DeathsBreath  = Hud.Game.Me.Materials.DeathsBreath;
            long ArcaneDust    = Hud.Game.Me.Materials.ArcaneDust;
            long VeiledCrystal = Hud.Game.Me.Materials.VeiledCrystal;
            long ReusableParts = Hud.Game.Me.Materials.ReusableParts;
            long ForgottenSoul = Hud.Game.Me.Materials.ForgottenSoul;
            long Regret        = Hud.Game.Me.Materials.LeoricsRegret;
            long Vial          = Hud.Game.Me.Materials.VialOfPutridness;
            long Idol          = Hud.Game.Me.Materials.IdolOfTerror;
            long Heart         = Hud.Game.Me.Materials.HeartOfFright;

            foreach (var Seller in Sellers)
            {
                if (Seller == null)
                {
                    continue;
                }
                if (Seller.SnoActor == null)
                {
                    continue;
                }
                if (Seller.SnoActor.Sno == 0)
                {
                    continue;
                }
                if (Seller.FloorCoordinate == null)
                {
                    continue;
                }

                if (Seller.SnoActor.Sno == ActorSnoEnum._x1_randomitemnpc /*361241*/) // Kadala
                {
                    string BloodShardsPlural = "s";
                    if (Hud.Game.Me.Materials.BloodShard == 1)
                    {
                        BloodShardsPlural = string.Empty;
                    }
                    string BloodShardsAmmount = "- You have " + Hud.Game.Me.Materials.BloodShard + " Blood Shard" + BloodShardsPlural + " out of " + (500 + (Hud.Game.Me.HighestSoloRiftLevel * 10)) + ".";
                    if (Hud.Game.Me.Materials.BloodShard == 0)
                    {
                        BloodShardsAmmount = "You have no Blood Shards.";
                    }

                    int    TwentyFive       = (int)(Hud.Game.Me.Materials.BloodShard / 25);
                    string TwentyFivePlural = "s";
                    string PhylacteryPlural = "phylacteries ";
                    if (TwentyFive == 1)
                    {
                        TwentyFivePlural = string.Empty; PhylacteryPlural = "phylactery ";
                    }

                    int    Fifty       = (int)(Hud.Game.Me.Materials.BloodShard / 50);
                    string FiftyPlural = "s";
                    if (Fifty == 1)
                    {
                        FiftyPlural = string.Empty;
                    }

                    int    SeventyFive       = (int)(Hud.Game.Me.Materials.BloodShard / 75);
                    string SeventyFivePlural = "s";
                    if (SeventyFive == 1)
                    {
                        SeventyFivePlural = string.Empty;
                    }

                    int    Hundred       = (int)(Hud.Game.Me.Materials.BloodShard / 100);
                    string HundredPlural = "s";
                    if (Hundred == 1)
                    {
                        HundredPlural = string.Empty;
                    }

                    string TwentyFiveClass  = string.Empty;
                    string FiftyClass       = string.Empty;
                    string SeventyFiveClass = string.Empty;
                    string HundredClass     = string.Empty;

                    switch (Hud.Game.Me.HeroClassDefinition.HeroClass.ToString())
                    {
                    case "Barbarian":
                        break;

                    case "DemonHunter":
                        TwentyFiveClass = "mystery quiver" + TwentyFivePlural + ", " + "helm" + TwentyFivePlural + ", " + "pair of gloves" + "," + Environment.NewLine + "pair of boots" + ", " + "chest armor" + TwentyFivePlural + ", " + "belt" + TwentyFivePlural + ", " + "pair of shoulders" + "," + Environment.NewLine + "pair of pants" + ", " + "pair of bracers" + " or " + "shield" + TwentyFivePlural + ".";
                        break;

                    case "Wizard":
                        TwentyFiveClass = "mystery orb" + TwentyFivePlural + ", " + "helm" + TwentyFivePlural + ", " + "pair of gloves" + "," + Environment.NewLine + "pair of boots" + ", " + "chest armor" + TwentyFivePlural + ", " + "belt" + TwentyFivePlural + ", " + "pair of shoulders" + "," + Environment.NewLine + "pair of pants" + ", " + "pair of bracers" + " or " + "shield" + TwentyFivePlural + ".";
                        break;

                    case "WitchDoctor":
                        TwentyFiveClass = "mystery mojo" + TwentyFivePlural + ", " + "helm" + TwentyFivePlural + ", " + "pair of gloves" + "," + Environment.NewLine + "pair of boots" + ", " + "chest armor" + TwentyFivePlural + ", " + "belt" + TwentyFivePlural + ", " + "pair of shoulders" + "," + Environment.NewLine + "pair of pants" + ", " + "pair of bracers" + " or " + "shield" + TwentyFivePlural + ".";
                        break;

                    case "Monk":
                    case "Crusader":
                        TwentyFiveClass = "helm" + TwentyFivePlural + ", " + "pair of gloves" + "," + Environment.NewLine + "pair of boots" + ", " + "chest armor" + TwentyFivePlural + ", " + "belt" + TwentyFivePlural + ", " + "pair of shoulders" + "," + Environment.NewLine + "pair of pants" + ", " + "pair of bracers" + " or " + "shield" + TwentyFivePlural + ".";
                        break;

                    case "Necromancer":
                        TwentyFiveClass = "mystery " + PhylacteryPlural + ", " + "helm" + TwentyFivePlural + ", " + "pair of gloves" + "," + Environment.NewLine + "pair of boots" + ", " + "chest armor" + TwentyFivePlural + ", " + "belt" + TwentyFivePlural + ", " + "pair of shoulders" + "," + Environment.NewLine + "pair of pants" + ", " + "pair of bracers" + " or " + "shield" + TwentyFivePlural + ".";
                        break;
                    }

                    FiftyClass       = "mystery ring" + FiftyPlural + ".";
                    SeventyFiveClass = "mystery weapon" + SeventyFivePlural + ".";
                    HundredClass     = "mystery amulet" + HundredPlural + ".";

                    string TwentyFiveMessage = string.Empty;
                    if (TwentyFive == 0)
                    {
                        TwentyFiveMessage = "- There's nothing I can sell you.";
                    }
                    else if (TwentyFive == 1)
                    {
                        TwentyFiveMessage = "- You can get one " + TwentyFiveClass;
                    }
                    else
                    {
                        TwentyFiveMessage = "- You can get " + TwentyFive + " " + TwentyFiveClass;
                    }

                    string FiftyMessage = string.Empty;
                    if (Fifty == 0)
                    {
                        FiftyMessage = string.Empty; if (KadalaSentence == 2)
                        {
                            KadalaSentence = 0;
                        }
                    }
                    else if (Fifty == 1)
                    {
                        FiftyMessage = "- I have also one " + FiftyClass;
                    }
                    else
                    {
                        FiftyMessage = "- I have also " + Fifty + " " + FiftyClass;
                    }

                    string SeventyFiveMessage = string.Empty;
                    if (SeventyFive == 0)
                    {
                        SeventyFiveMessage = string.Empty; if (KadalaSentence == 3)
                        {
                            KadalaSentence = 0;
                        }
                    }
                    else if (SeventyFive == 1)
                    {
                        SeventyFiveMessage = "- ... And one " + SeventyFiveClass;
                    }
                    else
                    {
                        SeventyFiveMessage = "- ... And " + SeventyFive + " " + SeventyFiveClass;
                    }

                    string HundredMessage = string.Empty;
                    if (Hundred == 0)
                    {
                        HundredMessage = string.Empty; if (KadalaSentence == 4)
                        {
                            KadalaSentence = 0;
                        }
                    }
                    else if (Hundred == 1)
                    {
                        HundredMessage = "- ... And to finish: One " + HundredClass;
                    }
                    else
                    {
                        HundredMessage = "- ... And to finish: " + Hundred + " " + HundredClass;
                    }

                    switch (KadalaSentence)
                    {
                    case 0:
                        SellerMessage = BloodShardsAmmount;
                        break;

                    case 1:
                        SellerMessage = TwentyFiveMessage;
                        break;

                    case 2:
                        SellerMessage = FiftyMessage;
                        break;

                    case 3:
                        SellerMessage = SeventyFiveMessage;
                        break;

                    case 4:
                        SellerMessage = HundredMessage;
                        break;
                    }
                    if (Seller.FloorCoordinate.IsOnScreen() && Seller.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40 && Seller != null)
                    {
                        SellerDecorator.Paint(layer, Seller, Seller.FloorCoordinate.Offset(0, 0, -2), SellerMessage);
                    }
                }
                else if (Seller.SnoActor.Sno == ActorSnoEnum._pt_jeweler /*56949*/) // Jeweler
                {
                    string GemSentence = string.Empty;

                    foreach (var Gem in GemsCount.OrderByDescending(i => i.Value).Take(1))
                    {
                        if (Gem.Key.Contains("Marquise") && Gem.Value > 3)
                        {
                            int    ImperialNumbers = (int)(Gem.Value / 3);
                            string ImperialColor   = Gem.Key.Replace("Marquise", string.Empty).Trim();
                            string MarquisePlural  = "s";
                            if (Gem.Value == 1)
                            {
                                MarquisePlural = string.Empty;
                            }
                            string ImperialPlural = "s";
                            if (ImperialNumbers == 1)
                            {
                                ImperialPlural = string.Empty;
                            }
                            if (ImperialColor == "Ruby" && ImperialNumbers > 1)
                            {
                                ImperialColor = "Rubie";
                            }
                            else if (ImperialColor == "Topaz" && ImperialNumbers > 1)
                            {
                                ImperialColor = "Topaze";
                            }
                            long Gold = (int)(ImperialNumbers * 200000);
                            if (Hud.Game.Me.Materials.Gold < Gold)
                            {
                                ImperialNumbers = (int)(Hud.Game.Me.Materials.Gold / 200000); Gold = (int)(ImperialNumbers * 200000);
                            }
                            string GoldString = Gold.ToString("N0", CultureInfo.InvariantCulture);
                            if (Hud.Game.Me.Materials.Gold >= Gold)
                            {
                                GemSentence = "- You have " + Gem.Value + " Marquise " + ImperialColor + MarquisePlural + Environment.NewLine + "  I can combine them into " + ImperialNumbers + " Imperial " + ImperialColor + ImperialPlural + Environment.NewLine + "  for " + GoldString + " gold.";
                            }
                        }
                        else if (Gem.Key.Contains("Flawless Imperial") && Gem.Value > 3)
                        {
                            int    RoyalNumbers           = (int)(Gem.Value / 3);
                            string RoyalColor             = Gem.Key.Replace("Fawless Imperial", string.Empty).Trim();
                            string FlawlessImperialPlural = "s";
                            if (Gem.Value == 1)
                            {
                                FlawlessImperialPlural = string.Empty;
                            }
                            string RoyalPlural = "s";
                            if (RoyalNumbers == 1)
                            {
                                RoyalPlural = string.Empty;
                            }
                            if (RoyalColor == "Ruby" && RoyalNumbers > 1)
                            {
                                RoyalColor = "Rubie";
                            }
                            else if (RoyalColor == "Topaz" && RoyalNumbers > 1)
                            {
                                RoyalColor = "Topaze";
                            }
                            long DeathBreaths = RoyalNumbers;
                            long Gold         = (int)(RoyalNumbers * 400000);
                            if (Hud.Game.Me.Materials.Gold < Gold)
                            {
                                RoyalNumbers = (int)(Hud.Game.Me.Materials.Gold / 400000); Gold = (int)(RoyalNumbers * 400000); DeathBreaths = RoyalNumbers;
                            }
                            if (Hud.Game.Me.Materials.DeathsBreath < DeathBreaths)
                            {
                                RoyalNumbers = (int)(Hud.Game.Me.Materials.DeathsBreath); Gold = (int)(RoyalNumbers * 400000); DeathBreaths = RoyalNumbers;
                            }
                            string GoldString = Gold.ToString("N0", CultureInfo.InvariantCulture);

                            if (Hud.Game.Me.Materials.Gold >= Gold && Hud.Game.Me.Materials.DeathsBreath >= DeathBreaths)
                            {
                                GemSentence = "- You have " + Gem.Value + " Fawless Imperial " + RoyalColor + FlawlessImperialPlural + Environment.NewLine + "  I can combine them into " + RoyalNumbers + " Royal " + RoyalColor + RoyalPlural + Environment.NewLine + "  for " + GoldString + " gold and " + DeathBreaths + "Death's Breath" + RoyalPlural + ".";
                            }
                        }
                        else if (Gem.Key.Contains("Imperial") && Gem.Value > 3)
                        {
                            int    FlawlessImperialNumbers = (int)(Gem.Value / 3);
                            string FlawlessImperialColor   = Gem.Key.Replace("Imperial", string.Empty).Trim();
                            string ImperialPlural          = "s";
                            if (Gem.Value == 1)
                            {
                                ImperialPlural = string.Empty;
                            }
                            string FlawlessImperialPlural = "s";
                            if (FlawlessImperialNumbers == 1)
                            {
                                FlawlessImperialPlural = string.Empty;
                            }
                            if (FlawlessImperialColor == "Ruby" && FlawlessImperialNumbers > 1)
                            {
                                FlawlessImperialColor = "Rubie";
                            }
                            else if (FlawlessImperialColor == "Topaz" && FlawlessImperialNumbers > 1)
                            {
                                FlawlessImperialColor = "Topaze";
                            }
                            long Gold = (int)(FlawlessImperialNumbers * 300000);
                            if (Hud.Game.Me.Materials.Gold < Gold)
                            {
                                FlawlessImperialNumbers = (int)(Hud.Game.Me.Materials.Gold / 300000); Gold = (int)(FlawlessImperialNumbers * 300000);
                            }
                            string GoldString = Gold.ToString("N0", CultureInfo.InvariantCulture);

                            if (Hud.Game.Me.Materials.Gold >= Gold)
                            {
                                GemSentence = "- You have " + Gem.Value + " Imperial " + FlawlessImperialColor + ImperialPlural + Environment.NewLine + "  I can combine them into " + FlawlessImperialNumbers + " Flawless Imperial " + FlawlessImperialColor + FlawlessImperialPlural + Environment.NewLine + "  for " + GoldString + " gold.";
                            }
                        }
                        else if (Gem.Key.Contains("Royal") && Gem.Value > 3)
                        {
                            int    FlawlessRoyalNumbers = (int)(Gem.Value / 3);
                            string FlawlessRoyalColor   = Gem.Key.Replace("Imperial", string.Empty).Trim();
                            string RoyalPlural          = "s";
                            if (Gem.Value == 1)
                            {
                                RoyalPlural = string.Empty;
                            }
                            string FlawlessRoyalPlural = "s";
                            if (FlawlessRoyalNumbers == 1)
                            {
                                FlawlessRoyalPlural = string.Empty;
                            }
                            if (FlawlessRoyalColor == "Ruby" && FlawlessRoyalNumbers > 1)
                            {
                                FlawlessRoyalColor = "Rubie";
                            }
                            else if (FlawlessRoyalColor == "Topaz" && FlawlessRoyalNumbers > 1)
                            {
                                FlawlessRoyalColor = "Topaze";
                            }
                            long Gold         = (int)(FlawlessRoyalNumbers * 500000);
                            long DeathBreaths = FlawlessRoyalNumbers;
                            if (Hud.Game.Me.Materials.Gold < Gold)
                            {
                                FlawlessRoyalNumbers = (int)(Hud.Game.Me.Materials.Gold / 500000); Gold = (int)(FlawlessRoyalNumbers * 500000); DeathBreaths = FlawlessRoyalNumbers;
                            }
                            if (Hud.Game.Me.Materials.DeathsBreath < DeathBreaths)
                            {
                                FlawlessRoyalNumbers = (int)(Hud.Game.Me.Materials.DeathsBreath); Gold = (int)(FlawlessRoyalNumbers * 500000); DeathBreaths = FlawlessRoyalNumbers;
                            }
                            string GoldString = Gold.ToString("N0", CultureInfo.InvariantCulture);

                            if (Hud.Game.Me.Materials.Gold >= Gold && Hud.Game.Me.Materials.DeathsBreath >= DeathBreaths)
                            {
                                GemSentence = "- You have " + Gem.Value + " Royal " + FlawlessRoyalColor + RoyalPlural + Environment.NewLine + "  I can combine them into " + FlawlessRoyalNumbers + " Flawless Royal " + FlawlessRoyalColor + FlawlessRoyalPlural + Environment.NewLine + "  for " + GoldString + " gold and " + DeathBreaths + "Death's Breath" + FlawlessRoyalPlural + ".";
                            }
                        }
                    }
                    if (GemSentence == string.Empty && JewellerSentence == 0)
                    {
                        JewellerSentence = 1;
                    }
                    string HellfireRingSentence   = string.Empty;
                    string HellfireAmuletSentence = string.Empty;

                    if (ForgottenSoul >= 10)
                    {
                        var  HellfireAmuletPlural = "s";
                        long HellfireAmuletNumber = Math.Min((int)(ForgottenSoul / 10), Math.Min(Regret, Math.Min(Vial, Math.Min(Idol, Heart))));
                        if (HellfireAmuletNumber == 1)
                        {
                            HellfireAmuletPlural = string.Empty;
                        }
                        else if (HellfireAmuletNumber == 0 && JewellerSentence == 1)
                        {
                            JewellerSentence = 2;
                        }
                        else
                        {
                            HellfireAmuletSentence = "- I can craft you " + HellfireAmuletNumber + " HellFire Amulet" + HellfireAmuletPlural + ".";
                        }
                    }

                    long HellfireRingNumber = Math.Min(Regret, Math.Min(Vial, Math.Min(Idol, Heart)));

                    var HellfireRingPlural = "s";
                    if (HellfireRingNumber == 1)
                    {
                        HellfireRingPlural = string.Empty;
                    }
                    else if (HellfireRingNumber == 0 && JewellerSentence == 2)
                    {
                        JewellerSentence = 3;
                    }
                    else
                    {
                        HellfireRingSentence = "- ...And also " + HellfireRingNumber + " HellFire Ring" + HellfireRingPlural + ".";
                    }

                    if (HellfireAmuletSentence == string.Empty && JewellerSentence == 1)
                    {
                        JewellerSentence = 2;
                    }
                    if (HellfireRingSentence == string.Empty && JewellerSentence == 2)
                    {
                        JewellerSentence = 3;
                    }

                    switch (JewellerSentence)
                    {
                    case 0:
                        SellerMessage = GemSentence;
                        break;

                    case 1:
                        SellerMessage = HellfireAmuletSentence;
                        break;

                    case 2:
                        SellerMessage = HellfireRingSentence;
                        break;

                    case 3:
                        SellerMessage = "...And extracting gems from your gear is free of course... *sigh*.";
                        break;
                    }
                    if (Seller.FloorCoordinate.IsOnScreen() && Seller.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40 && Seller != null)
                    {
                        SellerDecorator.Paint(layer, Seller, Seller.FloorCoordinate.Offset(0, 0, -2), SellerMessage);
                    }
                }
                else if (Seller.SnoActor.Sno == ActorSnoEnum._pt_mystic /*56948*/) // Mystik
                {
                    long ImperialRubies = 0;
                    if (GemsCount.TryGetValue("Imperial Ruby", out ImperialRubies))
                    {
                        ImperialRubies = GemsCount["Imperial Ruby"];
                    }
                    long ImperialTopaz = 0;
                    if (GemsCount.TryGetValue("Imperial Topaz", out ImperialTopaz))
                    {
                        ImperialTopaz = GemsCount["Imperial Topaz"];
                    }
                    long ImperialEmerald = 0;
                    if (GemsCount.TryGetValue("Imperial Emerald", out ImperialEmerald))
                    {
                        ImperialEmerald = GemsCount["Imperial Emerald"];
                    }
                    long ImperialDiamond = 0;
                    if (GemsCount.TryGetValue("Imperial Diamond", out ImperialDiamond))
                    {
                        ImperialDiamond = GemsCount["Imperial Diamond"];
                    }
                    long ImperialAmethyst = 0;
                    if (GemsCount.TryGetValue("Imperial Amethyst", out ImperialAmethyst))
                    {
                        ImperialAmethyst = GemsCount["Imperial Amethyst"];
                    }

                    long EnchantTrinketsCount = Math.Min((int)(ArcaneDust / 5), Math.Min((int)(VeiledCrystal / 15), Math.Min(ForgottenSoul, Math.Min(DeathsBreath, Math.Min(ImperialRubies, Math.Min(ImperialTopaz, Math.Min(ImperialEmerald, Math.Min(ImperialDiamond, ImperialAmethyst))))))));
                    long EnchantCount         = Math.Min((int)(ArcaneDust / 5), Math.Min((int)(VeiledCrystal / 15), Math.Min(ForgottenSoul, DeathsBreath)));

                    string EnchantTrinketsSentence = string.Empty;
                    string EnchantTrinketsPlural   = "s";
                    if (EnchantTrinketsCount == 1)
                    {
                        EnchantTrinketsPlural = string.Empty;
                    }
                    else if (EnchantTrinketsCount == 0 && MysticSentence == 0)
                    {
                        MysticSentence = 1;
                    }
                    else
                    {
                        EnchantTrinketsSentence = "- I sense from your materials that I can approximately enchant" + Environment.NewLine + "  " + EnchantTrinketsCount + " time" + EnchantTrinketsPlural + " one of your rings or Amulets.";
                    }

                    string EnchantSentence = string.Empty;
                    string EnchantPlural   = "s";
                    if (EnchantCount == 1)
                    {
                        EnchantPlural = string.Empty;
                    }
                    else if (EnchantCount == 0 && MysticSentence == 1)
                    {
                        MysticSentence = 2;
                    }
                    else
                    {
                        EnchantSentence = "- I can enchant at least " + EnchantCount + " time" + EnchantPlural + " one of your gear items.";
                    }

                    string TransmogSentence = string.Empty;
                    long   TransmogCount    = (int)(Hud.Game.Me.Materials.Gold / 50000);
                    string TransmogPlural   = "s";
                    if (TransmogCount == 1)
                    {
                        TransmogPlural = string.Empty;
                    }
                    else if (TransmogCount == 0 && MysticSentence == 3)
                    {
                        MysticSentence = 4;
                    }
                    else
                    {
                        TransmogSentence = "- You can have " + TransmogCount + " of the most expensive" + Environment.NewLine + "  transmog" + TransmogPlural + " with your gold.";
                    }

                    string DyeSentence = string.Empty;
                    long   DyeCount    = (int)(Hud.Game.Me.Materials.Gold / 5040);
                    string DyePlural   = "s";
                    if (DyeCount == 1)
                    {
                        DyePlural = string.Empty;
                    }
                    else if (DyeCount == 0 && MysticSentence == 4)
                    {
                        MysticSentence = 0;
                    }
                    else
                    {
                        DyeSentence = "- ...And you can dye " + DyeCount + " item" + TransmogPlural + " with your gold.";
                    }

                    switch (MysticSentence)
                    {
                    case 0:
                        SellerMessage = EnchantTrinketsSentence;
                        break;

                    case 1:
                        SellerMessage = EnchantSentence;
                        break;

                    case 2:
                        SellerMessage = "- Remember to keep Imperial gems of any type," + Environment.NewLine + "  I need some to enchant rings and amulets.";
                        break;

                    case 3:
                        SellerMessage = TransmogSentence;
                        break;

                    case 4:
                        SellerMessage = DyeSentence;
                        break;
                    }
                    if (Seller.FloorCoordinate.IsOnScreen() && Seller.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40 && Seller != null)
                    {
                        SellerDecorator.Paint(layer, Seller, Seller.FloorCoordinate.Offset(0, 0, -2), SellerMessage);
                    }
                }
                else if (Seller.SnoActor.Sno == ActorSnoEnum._pt_blacksmith /*56947*/) // Blacksmith
                {
                    int BellCount     = 0;
                    int MushroomCount = 0;
                    int RainbowCount  = 0;
                    int GemstoneCount = 0;
                    int ShinboneCount = 0;

                    var StaffStash = Hud.Inventory.ItemsInStash.Where(x => x.SnoItem.MainGroupCode == "pony" && x.Quantity != 0);
                    foreach (var Pony in StaffStash)
                    {
                        if (Pony == null)
                        {
                            continue;
                        }
                        if (Pony.SnoItem == null)
                        {
                            continue;
                        }
                        if (Pony.SnoItem.Sno == 0)
                        {
                            continue;
                        }

                        if (Pony.SnoItem.Sno == 3495098760)
                        {
                            BellCount++;
                        }
                        else if (Pony.SnoItem.Sno == 2301417192)
                        {
                            MushroomCount++;
                        }
                        else if (Pony.SnoItem.Sno == 725082635)
                        {
                            RainbowCount++;
                        }
                        else if (Pony.SnoItem.Sno == 3494992897)
                        {
                            GemstoneCount++;
                        }
                        else if (Pony.SnoItem.Sno == 3665447244)
                        {
                            ShinboneCount++;
                        }
                    }

                    var StaffInventory = Hud.Inventory.ItemsInInventory.Where(x => x.SnoItem.MainGroupCode == "pony" && x.Quantity != 0);
                    foreach (var Pony in StaffInventory)
                    {
                        if (Pony == null)
                        {
                            continue;
                        }
                        if (Pony.SnoItem == null)
                        {
                            continue;
                        }
                        if (Pony.SnoItem.Sno == 0)
                        {
                            continue;
                        }

                        if (Pony.SnoItem.Sno == 3495098760)
                        {
                            BellCount++;
                        }
                        else if (Pony.SnoItem.Sno == 2301417192)
                        {
                            MushroomCount++;
                        }
                        else if (Pony.SnoItem.Sno == 725082635)
                        {
                            RainbowCount++;
                        }
                        else if (Pony.SnoItem.Sno == 3494992897)
                        {
                            GemstoneCount++;
                        }
                        else if (Pony.SnoItem.Sno == 3665447244)
                        {
                            ShinboneCount++;
                        }
                    }
                    int  StaffCount     = Math.Min(BellCount, Math.Min(MushroomCount, Math.Min(RainbowCount, Math.Min(GemstoneCount, ShinboneCount))));
                    long CraftItemCount = Math.Min((int)(ArcaneDust / 30), Math.Min((int)(VeiledCrystal / 50), Math.Min((int)(ReusableParts / 30), Math.Min(Khanduran, Math.Min(Caldeum, Math.Min(Arreat, Math.Min(AngelFlesh, HolyWater)))))));
                    long HallowedBreach = Math.Min((int)(ReusableParts / 20), Math.Min((int)(ArcaneDust / 20), Math.Min((int)(VeiledCrystal / 30), Math.Min(Khanduran, Math.Min(AngelFlesh, (int)(Hud.Game.Me.Materials.Gold / 72000))))));

                    var    freeSpace         = Hud.Game.Me.InventorySpaceTotal - Hud.Game.InventorySpaceUsed;
                    string InventorySentence = string.Empty;
                    if (freeSpace <= 10)
                    {
                        InventorySentence = "- Time to empty your inventory is coming!" + Environment.NewLine + "  Let me salvage those...";
                    }
                    else if (BlackSmithSentence == 2)
                    {
                        BlackSmithSentence = 0;
                    }

                    string StaffSentence = string.Empty;
                    string StaffPlural   = "s";
                    if (StaffCount == 1)
                    {
                        StaffPlural = string.Empty;
                    }
                    else if (StaffCount == 0 && BlackSmithSentence == 0)
                    {
                        BlackSmithSentence = 1;
                    }
                    else
                    {
                        StaffSentence = "- I can craft you " + StaffCount + " Staff" + StaffPlural + " of Herding!";
                    }

                    string BestItemSentence = string.Empty;
                    if (CraftItemCount == 0 && BlackSmithSentence == 1)
                    {
                        BlackSmithSentence = 2;
                    }
                    else
                    {
                        BestItemSentence = "- You have enough materials to have " + CraftItemCount + " of my best items crafted!";
                    }

                    switch (BlackSmithSentence)
                    {
                    case 0:
                        SellerMessage = StaffSentence;
                        break;

                    case 1:
                        SellerMessage = BestItemSentence;
                        break;

                    case 2:
                        SellerMessage = InventorySentence;
                        break;
                    }
                    if (Seller.FloorCoordinate.IsOnScreen() && Seller.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40 && Seller != null)
                    {
                        SellerDecorator.Paint(layer, Seller, Seller.FloorCoordinate.Offset(0, 0, -2), SellerMessage);
                    }
                }
                else if (Seller.SnoActor.Sno == ActorSnoEnum._p2_hq_zoltunkulle /*429005*/) // Kulle
                {
                    var puzzleRingCount     = 0;
                    var bovineBardicheCount = 0;

                    foreach (var item in Hud.Inventory.ItemsInStash)
                    {
                        if (item.SnoItem.Sno == 2346057823)
                        {
                            bovineBardicheCount += (int)item.Quantity;                                 // Bovine Bardiche
                        }
                        if (item.SnoItem.Sno == 3106130529)
                        {
                            puzzleRingCount += (int)item.Quantity;                                 // Puzzle Ring
                        }
                    }

                    foreach (var item in Hud.Inventory.ItemsInInventory)
                    {
                        if (item.SnoItem.Sno == 2346057823)
                        {
                            bovineBardicheCount += (int)item.Quantity;                                 // Bovine Bardiche
                        }
                        if (item.SnoItem.Sno == 3106130529)
                        {
                            puzzleRingCount += (int)item.Quantity;                                 // Puzzle Ring
                        }
                    }

                    puzzleRingCount     = Math.Abs(puzzleRingCount);
                    bovineBardicheCount = Math.Abs(bovineBardicheCount);

                    long Extract = Math.Min(Khanduran, Math.Min(Caldeum, Math.Min(Arreat, Math.Min(AngelFlesh, Math.Min(HolyWater, (int)(DeathsBreath / 5))))));
                    long Reforge = Math.Min((int)(Khanduran / 5), Math.Min((int)(Caldeum / 5), Math.Min((int)(Arreat / 5), Math.Min((int)(AngelFlesh / 5), Math.Min((int)(HolyWater / 5), (int)(ForgottenSoul / 50))))));
                    long Upgrade = Math.Min((int)(VeiledCrystal / 50), Math.Min((int)(ArcaneDust / 50), Math.Min((int)(ReusableParts / 50), (int)(DeathsBreath / 25))));
                    long Convert = Math.Min((int)(DeathsBreath / 10), (int)(ForgottenSoul / 10));

                    string ConvertSentence = string.Empty;
                    string ConvertPlural   = "s";
                    if (Convert == 1)
                    {
                        ConvertPlural = string.Empty;
                    }
                    else if (Convert == 0 && KulleSentence == 5)
                    {
                        KulleSentence = 0;
                    }
                    else
                    {
                        ConvertSentence = "- You can convert a set item " + Convert + " time" + ConvertPlural + ".";
                    }

                    string UpgradeSentence = string.Empty;
                    string UpgradePlural   = "s";
                    if (Upgrade == 1)
                    {
                        UpgradePlural = string.Empty;
                    }
                    else if (Upgrade == 0 && KulleSentence == 4)
                    {
                        KulleSentence = 5;
                    }
                    else
                    {
                        UpgradeSentence = "- You can upgrade " + Upgrade + " rare item" + UpgradePlural + ".";
                    }

                    string ReforgeSentence = string.Empty;
                    string ReforgePlural   = "s";
                    if (Reforge == 1)
                    {
                        ReforgePlural = string.Empty;
                    }
                    else if (Reforge == 0 && KulleSentence == 3)
                    {
                        KulleSentence = 4;
                    }
                    else
                    {
                        ReforgeSentence = "- You can reforge " + Reforge + " legendary item" + ReforgePlural + ".";
                    }

                    string ExtractSentence = string.Empty;
                    string ExtractPlural   = "s";
                    if (Extract == 1)
                    {
                        ExtractPlural = string.Empty;
                    }
                    else if (Extract == 0 && KulleSentence == 2)
                    {
                        KulleSentence = 3;
                    }
                    else
                    {
                        ExtractSentence = "- You can extract " + Extract + " legendary power" + ExtractPlural + ".";
                    }

                    string GoblinSentence = string.Empty;
                    string GoblinPlural   = "s";
                    if (puzzleRingCount == 1)
                    {
                        GoblinPlural = string.Empty;
                    }
                    else if (puzzleRingCount == 0 && KulleSentence == 1)
                    {
                        KulleSentence = 2;
                    }
                    else
                    {
                        GoblinSentence = "- You have " + puzzleRingCount + " ticket" + GoblinPlural + " to Greed's realm.";
                    }

                    string BovineSentence = string.Empty;
                    string BovinePlural   = "s";
                    if (bovineBardicheCount == 1)
                    {
                        BovinePlural = string.Empty;
                    }
                    else if (bovineBardicheCount == 0 && KulleSentence == 0)
                    {
                        KulleSentence = 1;
                    }
                    else
                    {
                        BovineSentence = "- I can help you access to a place that doesn't exist " + bovineBardicheCount + " time" + BovinePlural + ".";
                    }

                    switch (KulleSentence)
                    {
                    case 0:
                        SellerMessage = BovineSentence;
                        break;

                    case 1:
                        SellerMessage = GoblinSentence;
                        break;

                    case 2:
                        SellerMessage = ExtractSentence;
                        break;

                    case 3:
                        SellerMessage = ReforgeSentence;
                        break;

                    case 4:
                        SellerMessage = UpgradeSentence;
                        break;

                    case 5:
                        SellerMessage = ConvertSentence;
                        break;
                    }
                    if (Convert == 0 && Upgrade == 0 && Reforge == 0 && Extract == 0 && puzzleRingCount == 0 && bovineBardicheCount == 0)
                    {
                    }
                    else if (Seller.FloorCoordinate.IsOnScreen() && Seller.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40 && Seller != null)
                    {
                        SellerDecorator.Paint(layer, Seller, Seller.FloorCoordinate.Offset(0, 0, -2), SellerMessage);
                    }
                }
            }
        }
Exemplo n.º 8
0
        public void PaintWorld(WorldLayer layer)
        {
            var actors = Hud.Game.Actors;
            var me     = Hud.Game.Me;

            remaining = 1.25f - ((Hud.Game.CurrentGameTick - starpactstarttict) / 60.0f);
            if (starpacttimerRunning == true && remaining <= 0)
            {
                starpacttimerRunning = false;
            }
            if (remaining < 0)
            {
                remaining = 0;
            }
            foreach (var actor in actors)
            {
                switch (actor.SnoActor.Sno)
                {
                case 217142:
                    meteorcircleDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Wizard)
                    {
                        meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        break;
                    }
                    if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                    {
                        if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && me.Stats.ResourceCurArcane < 5)
                        {
                            if (!starpacttimerRunning)
                            {
                                starpactstarttict    = Hud.Game.CurrentGameTick;
                                starpacttimerRunning = true;
                            }
                            meteorstringDeco.Paint(layer, actor, actor.FloorCoordinate, "별약");
                            if (timeron)
                            {
                                meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate.Offset(0, 0, -3), null);
                            }
                            break;
                        }
                        if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && remaining >= 0.1)
                        {
                            if (starpacttimerRunning)
                            {
                                starpacttimerRunning = false;
                            }
                            meteorstringDeco.Paint(layer, actor, actor.FloorCoordinate, "별약");
                            if (timeron)
                            {
                                meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate.Offset(0, 0, -3), null);
                            }
                            break;
                        }
                        if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && remaining < 0.1 && remaining > 0)
                        {
                            if (timeron)
                            {
                                meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate.Offset(0, 0, -3), null);
                            }
                            if (starpacttimerRunning)
                            {
                                starpacttimerRunning = false;
                            }
                            if (me.Powers.BuffIsActive(430674, 1) && me.Powers.BuffIsActive(134456))
                            {
                                meteorvisionstringDeco.Paint(layer, actor, actor.FloorCoordinate, "비전별약" + "+아케인");
                                break;
                            }
                            if (me.Powers.BuffIsActive(134456))
                            {
                                meteorstringDeco.Paint(layer, actor, actor.FloorCoordinate, "별약" + "+아케인");
                                break;
                            }
                            if (me.Powers.BuffIsActive(430674, 1) && me.Powers.BuffIsActive(91549))
                            {
                                meteorvisionstringDeco.Paint(layer, actor, actor.FloorCoordinate, "비전별약" + "+파열");
                                break;
                            }
                            if (me.Powers.BuffIsActive(91549))
                            {
                                meteorstringDeco.Paint(layer, actor, actor.FloorCoordinate, "별약" + "+파열");
                                break;
                            }
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 9
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!Hud.Game.IsInTown)
            {
                return;
            }

            short NemesisCount = 0;
            var   NemPlayer    = "";

            foreach (var player in Hud.Game.Players.OrderBy(p => p.PortraitIndex))
            {
                if (player == null)
                {
                    continue;
                }

                var Nemesis = player.Powers.GetBuff(318820);            // Nemesis Bracers

                if (Nemesis != null && Nemesis.Active)
                {
                    NemesisCount++;
                    if (NemesisCount > 1)       // more than one player
                    {
                        NemPlayer += ", ";
                    }
                    NemPlayer += player.BattleTagAbovePortrait;
                }
            }

            var NemStr = NemesisCount.ToString("0");

            if (NemesisCount > 0)
            {
                NemStr += " -> " + NemPlayer;
            }

            w = NemStr.Length * 12;       // 12 pixel per letter (FYI, I'm using Hangul, which is Korean language)
            if (w < 150)
            {
                w = 150;
            }
            h = 55;
            x = Hud.Window.Size.Width / 2 - 480;
            y = 20;
            NemesisPlayerDecorator.Paint(x, y, w, h, NemStr, "Nemesis bracers");

            if (Hud.Render.GetUiElement("Root.NormalLayer.rift_dialog_mainPage").Visible)
            {
                var me = Hud.Game.Me;
                if (NemesisCount == 0)
                {
                    var WarningMsg = "No Nemesis bracers!";
                    WarningMessageDecorator.Paint(layer, null, me.FloorCoordinate.Offset(0, 0, 15), WarningMsg);

                    if (Hud.Sound.LastSpeak.TimerTest(4000))
                    {
                        Hud.Sound.Speak(WarningMsg);
                        Console.Beep(900, 200);
                    }
                }
                else if (NemesisCount > 1)
                {
                    var WarningMsg = "More than 1 Nemesis bracers -> " + NemesisCount.ToString("0");
                    NoticeMessageDecorator.Paint(layer, null, me.FloorCoordinate.Offset(0, 0, 15), WarningMsg);
                }
            }
        }
Exemplo n.º 10
0
        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();
        }
Exemplo n.º 11
0
        public void PaintWorld(WorldLayer layer)
        {
            List <string> missingPlayers = new List <string>();
            List <string> nemesisPlayers = new List <string>();
            bool          nemesisEquiped = false;
            bool          nemesisInGroup = false;
            bool          missingPlayer  = false;

            foreach (var player in Hud.Game.Players.OrderBy(p => p.PortraitIndex))
            {
                if (player == null)
                {
                    continue;
                }

                if (!player.IsMe && player.IsInGame)
                {
                    if (player.IsDead || player.SnoArea != Hud.Game.Me.SnoArea || !player.CoordinateKnown)
                    {
                        missingPlayers.Add(player.BattleTagAbovePortrait);
                    }
                }

                var nemesisBuff = player.Powers.GetBuff(318820);

                if (nemesisBuff == null || !nemesisBuff.Active)
                {
                }
                else
                if (player.IsMe)
                {
                    nemesisEquiped = true;
                }
                else
                {
                    nemesisPlayers.Add(player.BattleTagAbovePortrait);
                }
            }

            nemesisInGroup = nemesisPlayers.Count > 0;
            missingPlayer  = missingPlayers.Count > 0;

            string message = string.Empty;
            WorldDecoratorCollection dec = null;

            if (nemesisEquiped)
            {
                if (missingPlayer)
                {
                    message = "Wait for:\n" + string.Join("\n", missingPlayers.ToArray());
                    dec     = DecoratorOrange;
                }
                else
                {
                    message = "Take";
                    dec     = DecoratorGreen;
                }
            }
            else
            {
                dec = DecoratorRed;
                if (nemesisInGroup)
                {
                    message = "Leave for:\n" + string.Join("\n", nemesisPlayers.ToArray());
                }
                else
                {
                    message = "No nemesis :(";
                }
            }


            var shrines = Hud.Game.Shrines.Where(x => !x.IsDisabled && !x.IsOperated);

            foreach (var shrine in shrines)
            {
                if (shrine.Type == ShrineType.HealingWell)
                {
                    continue;
                }
                if (shrine.Type == ShrineType.PoolOfReflection)
                {
                    continue;
                }

                if (shrine.FloorCoordinate.Offset(0, 0, 10).IsOnScreen())
                {
                    dec.Paint(layer, null, shrine.FloorCoordinate.Offset(0, 0, 10), message);
                }
            }
        }
Exemplo n.º 12
0
 protected Stair(EALNouns _name, WorldLayer _leadToLayer, Material _material)
     : base(_name, _material)
 {
     m_leadToLayer = _leadToLayer;
     Sex           = ESex.FEMALE;
 }
Exemplo n.º 13
0
        public void PaintWorld(WorldLayer layer)
        {
            var actors = Hud.Game.Actors;

            foreach (var actor in actors)
            {
                if (actor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId)
                {
                    switch (actor.SnoActor.Sno)
                    {
                    case 81230:     // light
                    case 81232:     // arcane
                    case 325807:
                    case 83024:
                        HydraDecorator.Paint(layer, actor, actor.FloorCoordinate.Offset(2f, 2f, 0), null);
                        break;

                    case 83959:     // mammoth
                        HydraDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        break;

                    case 141402:
                    case 150025:
                    case 150024:
                    case 168815:
                    case 150026:
                    case 150027:
                        if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))
                        {
                            SentryDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        else
                        {
                            SentryWithCustomEngineeringDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        break;

                    case 341426:
                    case 341411:
                    case 341381:
                    case 341396:
                    case 341441:
                        BlackHoleDecorator.Paint(layer, actor, actor.FloorCoordinate.Offset(0, 0, 5.2f), null);
                        break;

                    case 107705:
                    case 106584:
                    {
                        var skill = Hud.Game.Me.Powers.UsedWitchDoctorPowers.SpiritWalk;
                        if (skill != null)
                        {
                            if (skill.Rune == 1)
                            {
                                SpiritWalkWithJauntDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                            }
                            else
                            {
                                SpiritWalkDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                            }
                        }
                    }
                    break;

                    case 117574:
                    case 182276:
                    case 182278:
                    case 182271:
                    case 182283:
                    {
                        var skill = Hud.Game.Me.Powers.UsedWitchDoctorPowers.BigBadVoodoo;
                        if (skill != null)
                        {
                            if (skill.Rune == 1)
                            {
                                BigBadVoodooWithJungleDrumsDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                            }
                            else
                            {
                                BigBadVoodooDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                            }
                        }
                    }
                    break;
                    }
                }
                switch (actor.SnoActor.Sno)
                {
                case 357846:
                    PiranhadoDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case 149848:
                    InnerSanctuarySanctifiedGroundDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case 320136:
                case 319583:
                case 319337:
                    InnerSanctuaryDefaultDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case 320135:
                    InnerSanctuarySafeHavenDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case 319776:
                    InnerSanctuaryTempleOfProtecteionDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;
                }
            }
        }
Exemplo n.º 14
0
        public void PaintWorld(WorldLayer layer)
        {
            var players = Hud.Game.Players.Where(player => !player.IsMe && player.CoordinateKnown && (player.HeadStone == null));

            foreach (var player in players)
            {
                if (player == null)
                {
                    continue;
                }
                var ScreenWidth      = Hud.Window.Size.Width;
                var ScreenHeight     = Hud.Window.Size.Height;
                var HeroTexture      = Hud.Texture.GetTexture(890155253);
                var HPbarWidth       = (float)(ScreenWidth / 13);
                var HPbarHeight      = (float)(ScreenHeight / 130);
                var ResbarWidth      = (float)(ScreenWidth / 13);
                var ResbarHeight     = (float)(ScreenHeight / 200);
                var CurRes           = 0f;
                var CurRes2          = 0f;
                var ScreenCoordinate = player.FloorCoordinate.ToScreenCoordinate();
                var PlayerX          = ScreenCoordinate.X;
                var PlayerY          = ScreenCoordinate.Y;
                if (HPbar == true)
                {
                    var CurHealth = player.Defense.HealthCur / player.Defense.HealthMax;
                    BorderBrush.DrawRectangle(PlayerX - (float)HPbarWidth / 2, PlayerY - (float)(ScreenHeight / 16) / 2, HPbarWidth, HPbarHeight);
                    BackgroundBrush.DrawRectangle(PlayerX - (float)HPbarWidth / 2, PlayerY - (float)(ScreenHeight / 16) / 2, HPbarWidth, HPbarHeight);
                    HPbarBrush.DrawRectangle(PlayerX - (float)HPbarWidth / 2, PlayerY - (float)(ScreenHeight / 16) / 2, HPbarWidth * CurHealth, HPbarHeight);
                }

                if (player.HeroClassDefinition.HeroClass.ToString() == "Barbarian")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurFury / player.Stats.ResourceMaxFury;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        FuryBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }

                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3921484788);                    // male/female can't be determined, let's keep it for later...
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1030273087);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Crusader")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurWrath / player.Stats.ResourceMaxWrath;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        WrathBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3742271755);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(3435775766);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "DemonHunter")
                {
                    if (Resbar == true)
                    {
                        CurRes  = player.Stats.ResourceCurHatred / player.Stats.ResourceMaxHatred;
                        CurRes2 = player.Stats.ResourceCurDiscipline / player.Stats.ResourceMaxDiscipline;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        HatreBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 40) / 1.45f, ResbarWidth, ResbarHeight);
                        DisciplineBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 40) / 1.45f, ResbarWidth * CurRes2, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3785199803);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2939779782);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Monk")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurSpirit / player.Stats.ResourceMaxSpirit;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        SpiritBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(2227317895);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2918463890);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Necromancer")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurEssence / player.Stats.ResourceMaxEssence;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        EssenceBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3285997023);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(473831658);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "WitchDoctor")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurMana / player.Stats.ResourceMaxMana;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        ManaBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3925954876);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1603231623);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Wizard")
                {
                    if (Resbar == true)
                    {
                        CurRes = player.Stats.ResourceCurArcane / player.Stats.ResourceMaxArcane;
                        BackgroundBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth, ResbarHeight);
                        ArcaneBrush.DrawRectangle(PlayerX - (float)ResbarWidth / 2, PlayerY - (float)(ScreenHeight / 28) / 1.6f, ResbarWidth * CurRes, ResbarHeight);
                    }
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(44435619);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(876580014);
                    }
                }

                if (Tag == true)
                {
                    string battleTag = player.BattleTagAbovePortrait;
                    if (battleTag == null)
                    {
                        continue;
                    }
                    TagDecorator.TextFunc = () => battleTag.ToString();
                    var BattleTagTexture = Hud.Texture.GetTexture(3098562643);
                    BattleTagTexture.Draw(PlayerX - (float)(ScreenWidth / 10) / 2, PlayerY - (float)(ScreenHeight / 7.8f) / 2, (float)(ScreenWidth / 10), (float)(ScreenHeight / 28), 0.7843f);
                    HeroTexture.Draw(PlayerX - (float)(Hud.Window.Size.Height / 31) / 2, PlayerY - (float)(ScreenHeight / 6.1f) / 2, (float)(ScreenHeight / 31), (float)(Hud.Window.Size.Height / 31), 1f);
                    TagDecorator.Paint(PlayerX - (float)(ScreenWidth / 11.5) / 2, PlayerY - (float)(ScreenHeight / 9.23f) / 2, (float)(ScreenWidth / 11.5), (float)(ScreenHeight / 45), HorizontalAlign.Center);
                }
            }
        }
Exemplo n.º 15
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)
                {
                    if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out var decorator))
                    {
                        continue;
                    }

                    var affixName = CustomAffixNames.ContainsKey(snoMonsterAffix.Affix) ? CustomAffixNames[snoMonsterAffix.Affix] : 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;
                }
            }
        }
Exemplo n.º 16
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);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 17
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();
        }
    void CollideWithTerrain(Player player, Vector3i position)
    {
        if (player != this.Controller)
        {
            return;
        }

        lock (this)
        {
            if (this.groundHits == null)
            {
                this.groundHits = new ThreadSafeHashSet <Vector3i>();
            }
        }

        WorldLayer playerActivity = WorldLayerManager.GetLayer(LayerNames.PlayerActivity);

        // destroy plants and spawn dirt within a radius under the hit position
        int radius = 1;

        for (int x = -radius; x <= radius; x++)
        {
            for (int z = -radius; z <= radius; z++)
            {
                var offsetpos = position + new Vector3i(x, -1, z);
                if (!this.groundHits.Add(offsetpos))
                {
                    continue;
                }

                var abovepos   = offsetpos + Vector3i.Up;
                var aboveblock = World.GetBlock(abovepos);
                var hitblock   = World.GetBlock(offsetpos);
                if (!aboveblock.Is <Solid>())
                {
                    // turn soil into dirt
                    if (hitblock.GetType() == typeof(GrassBlock) || hitblock.GetType() == typeof(ForestSoilBlock))
                    {
                        player.SpawnBlockEffect(offsetpos, typeof(DirtBlock), BlockEffect.Delete);
                        World.SetBlock <DirtBlock>(offsetpos);
                        BiomePusher.AddFrozenColumn(offsetpos.XZ);
                    }

                    // kill any above plants
                    if (aboveblock is PlantBlock)
                    {
                        // make sure there is a plant here, sometimes world/ecosim are out of sync
                        var plant = EcoSim.PlantSim.GetPlant(abovepos);
                        if (plant != null)
                        {
                            player.SpawnBlockEffect(abovepos, aboveblock.GetType(), BlockEffect.Delete);
                            EcoSim.PlantSim.DestroyPlant(plant, DeathType.Deforestation);
                        }
                        else
                        {
                            World.DeleteBlock(abovepos);
                        }
                    }

                    if (hitblock.Is <Solid>() && World.GetBlock(abovepos).Is <Empty>() && RandomUtil.Value < this.Species.ChanceToSpawnDebris)
                    {
                        Block placedBlock = World.SetBlock(typeof(TreeDebrisBlock), abovepos);
                        player.SpawnBlockEffect(abovepos, typeof(TreeDebrisBlock), BlockEffect.Place);
                        RoomData.QueueRoomTest(abovepos);
                    }
                }
            }
        }
    }
Exemplo n.º 19
0
 public abstract void GenerateCityBlock(MapBlock _block, Random _rnd, WorldLayer _worldLayer);
Exemplo n.º 20
0
        public void PaintWorld(WorldLayer layer)
        {
            var actors = Hud.Game.Actors;

            foreach (var actor in actors)
            {
                /* ---  Skills where "summoned_by_me" works  --- */

                if (actor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId) // summoned_by_me
                {
                    // TODO: fix this by using enum values
                    switch (actor.SnoActor.Sno)
                    {
                    // Sentry
                    case ActorSnoEnum._dh_sentry /*141402*/:              // No rune // DH_sentry
                    case ActorSnoEnum._dh_sentry_tether /*168815*/:       // Chain of Torment, rune 0 // DH_sentry_tether
                    case ActorSnoEnum._dh_sentry_addsduration /*150024*/: // Impaling Bolt, rune 1 // DH_sentry_addsDuration
                    case ActorSnoEnum._dh_sentry_addsmissiles /*150025*/: // Spitfire Turret, rune 2 // DH_sentry_addsMissiles
                        if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))  // without Custom Engineering passive
                        {
                            SentryCeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        else     // with Custom Engineering passive
                        {
                            SentryCeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        break;

                    case ActorSnoEnum._dh_sentry_addsheals /*150026*/:    // Polar Station, rune 3 // DH_sentry_addsHeals
                        SentryPolarDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))  // without Custom Engineering passive
                        {
                            SentryDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        else     // with Custom Engineering passive
                        {
                            SentryCeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        break;

                    case ActorSnoEnum._dh_sentry_addsshield /*150027*/:    // Guardian Turret, rune 4 // DH_sentry_addsShield
                        SentryGuardianDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        if (!Hud.Game.Me.Powers.BuffIsActive(208610, 0))   // without Custom Engineering passive
                        {
                            SentryDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        else     // with Custom Engineering passive
                        {
                            SentryCeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        break;
                    }
                }


                /* ---  Skills where "summoned_by_me" does not work  --- */
                switch (actor.SnoActor.Sno)
                {
                // Marked For Death
                case ActorSnoEnum._dh_markedfordeath_proxyactor /*230674*/:    // Valley of Death, rune 2 // DH_MarkedForDeath_proxyActor
                    MfdVodDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;


                // Rain of Vengeance
                case ActorSnoEnum._demonhunter_rainofarrows /*131701*/:                      // No rune // DemonHunter_RainOfArrows
                case ActorSnoEnum._demonhunter_rainofarrows_alabaster_discipline /*151842*/: // Shade, rune 0 // DemonHunter_RainOfArrows_alabaster_discipline
                    RoVShadeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case ActorSnoEnum._demonhunter_rainofarrows_indigo_buff /*153029*/:    // Dark Cloud, rune 1 // DemonHunter_RainOfArrows_indigo_buff
                    RoVDarkCloudDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                // case 154292: // Anathema, Rune 2 // DH_rainOfArrows_projectile_grenades (grenade explosion + sky source)
                case ActorSnoEnum._dh_rainofarrows_grenade_launcher /*155276*/:    // Anathema, Rune 2 // DH_rainOfArrows_grenade_launcher
                    RoVAnathemaDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case ActorSnoEnum._demonhunter_rainofarrows_kamikaze /*200561*/:    // Flying Strike, rune 3 // DemonHunter_RainOfArrows_kamikaze
                    RoVFlyingStrikeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;

                case ActorSnoEnum._x1_dh_rainofarrows_flyercrash_projectile /*370495*/:    // Stampede, rune 4 // x1_DH_rainOfArrows_flyerCrash_projectile
                    RoVStampedeDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                    break;


                // Grenade
                case ActorSnoEnum._demonhunter_grenade_projectile /*88244*/:          // All Grenades launch projectile (except Cold Grenade) // DemonHunter_Grenade_Projectile
                case ActorSnoEnum._p1_demonhunter_grenade_projectile_cold /*428572*/: // Cold Grenade launch projectile // p1_DemonHunter_Grenade_Projectile_cold
                case ActorSnoEnum._grenadeproxy_norune /*154027*/:                    // No rune // GrenadeProxy_NoRune
                case ActorSnoEnum._grenadeproxy_crimson_aoe /*154076*/:               // Cold Grenade, rune 0 // GrenadeProxy_Crimson_AOE
                case ActorSnoEnum._grenadeproxy_indigo /*154028*/:                    // Cluster Grenades, rune 1 // GrenadeProxy_Indigo
                // case ActorSnoEnum./*154027*/: // Grenade Cache, rune 2 (shared with No rune) // GrenadeProxy_NoRune
                case ActorSnoEnum._grenadeproxy_golden /*154046*/:                    // Tinkerer, rune 3 // GrenadeProxy_Golden
                case ActorSnoEnum._grenadeproxy_alabaster /*154043*/:                 // Stun Grenade, rune 4 // GrenadeProxy_Alabaster
                {
                    var skill = Hud.Game.Me.Powers.UsedDemonHunterPowers.Grenades;
                    if (skill != null)
                    {
                        if (skill.Rune == 1)                                         // with Cluster Grenades rune
                        {
                            GrenadeCGDeco.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                        else                                         // Without Cluster Grenades rune
                        {
                            GrenadeDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
                        }
                    }
                }
                break;
                }
            }
        }
Exemplo n.º 21
0
        private static void DrawWorld(RenderContext ctx, FontCache styleRes, World world, WorldLayer layer)
        {
            bool isPlaceholder = world.IsPlaceholder;
            bool isCapital = world.IsCapital;
            bool isHiPop = world.IsHi;
            bool renderName = ctx.styles.worldDetails.HasFlag(WorldDetails.AllNames) ||
                (ctx.styles.worldDetails.HasFlag(WorldDetails.KeyNames) && (isCapital || isHiPop));
            bool renderUWP = ctx.styles.worldDetails.HasFlag(WorldDetails.Uwp);

            using (RenderUtil.SaveState(ctx.graphics))
            {
                XPen pen = new XPen(XColor.Empty);
                XSolidBrush solidBrush = new XSolidBrush();

                ctx.graphics.SmoothingMode = XSmoothingMode.AntiAlias;

                // Center on the parsec
                PointF center = Astrometrics.HexToCenter(world.Coordinates);

                XMatrix matrix = new XMatrix();
                matrix.TranslatePrepend(center.X, center.Y);
                matrix.ScalePrepend(ctx.styles.hexContentScale / Astrometrics.ParsecScaleX, ctx.styles.hexContentScale / Astrometrics.ParsecScaleY);
                ctx.graphics.MultiplyTransform(matrix, XMatrixOrder.Prepend);

                if (!ctx.styles.useWorldImages)
                {
                    if (layer == WorldLayer.Background)
                    {
                        #region Zone
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.Zone))
                        {
                            Stylesheet.StyleElement? maybeElem = ZoneStyle(ctx, world);
                            if (maybeElem.HasValue)
                            {
                                Stylesheet.StyleElement elem = maybeElem.Value;
                                if (!elem.fillColor.IsEmpty)
                                {
                                    solidBrush.Color = elem.fillColor;
                                    ctx.graphics.DrawEllipse(solidBrush, -0.4f, -0.4f, 0.8f, 0.8f);
                                }

                                PenInfo pi = elem.pen;
                                if (!pi.color.IsEmpty)
                                {
                                    pi.Apply(ref pen);

                                    if (renderName && ctx.styles.fillMicroBorders)
                                    {
                                        using (RenderUtil.SaveState(ctx.graphics))
                                        {
                                            ctx.graphics.IntersectClip(new RectangleF(-.5f, -.5f, 1f, renderUWP ? 0.65f : 0.75f));
                                            ctx.graphics.DrawEllipse(pen, -0.4f, -0.4f, 0.8f, 0.8f);
                                        }
                                    }
                                    else
                                    {
                                        ctx.graphics.DrawEllipse(pen, -0.4f, -0.4f, 0.8f, 0.8f);
                                    }
                                }
                            }
                        }
                        #endregion

                        #region Hex
                        if (!ctx.styles.numberAllHexes &&
                            ctx.styles.worldDetails.HasFlag(WorldDetails.Hex))
                        {
                            string hex;
                            switch (ctx.styles.hexCoordinateStyle)
                            {
                                default:
                                case Stylesheet.HexCoordinateStyle.Sector: hex = world.Hex; break;
                                case Stylesheet.HexCoordinateStyle.Subsector: hex = world.SubsectorHex; break;
                            }
                            solidBrush.Color = ctx.styles.hexNumber.textColor;
                            ctx.graphics.DrawString(hex, ctx.styles.hexNumber.Font, solidBrush, 0.0f, -0.5f, RenderUtil.StringFormatTopCenter);
                        }
                        #endregion
                    }

                    if (layer == WorldLayer.Foreground)
                    {
                        Stylesheet.StyleElement? elem = ZoneStyle(ctx, world);
                        TextBackgroundStyle worldTextBackgroundStyle = (elem.HasValue && !elem.Value.fillColor.IsEmpty)
                            ? TextBackgroundStyle.None : ctx.styles.worlds.textBackgroundStyle;

                        #region Name
                        if (renderName)
                        {
                            string name = world.Name;
                            if ((isHiPop && ctx.styles.worldDetails.HasFlag(WorldDetails.Highlight)) || ctx.styles.worlds.textStyle.Uppercase)
                                name = name.ToUpperInvariant();

                            Color textColor = (isCapital && ctx.styles.worldDetails.HasFlag(WorldDetails.Highlight))
                                ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                            XFont font = ((isHiPop || isCapital) && ctx.styles.worldDetails.HasFlag(WorldDetails.Highlight))
                                ? ctx.styles.worlds.LargeFont : ctx.styles.worlds.Font;

                            DrawWorldLabel(ctx, worldTextBackgroundStyle, solidBrush, textColor, ctx.styles.worlds.textStyle.Translation, font, name);
                        }
                        #endregion

                        #region Allegiance
                        // TODO: Mask off background for allegiance
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.Allegiance))
                        {
                            string alleg = world.Allegiance;
                            if (!SecondSurvey.IsDefaultAllegiance(alleg))
                            {
                                if (!ctx.styles.t5AllegianceCodes && alleg.Length > 2)
                                    alleg = SecondSurvey.T5AllegianceCodeToLegacyCode(alleg);

                                solidBrush.Color = ctx.styles.worlds.textColor;

                                if (ctx.styles.lowerCaseAllegiance)
                                    alleg = alleg.ToLowerInvariant();

                                ctx.graphics.DrawString(alleg, ctx.styles.worlds.SmallFont, solidBrush, ctx.styles.AllegiancePosition.X, ctx.styles.AllegiancePosition.Y, RenderUtil.StringFormatCentered);
                            }
                        }
                        #endregion

                        if (!isPlaceholder)
                        {
                            #region GasGiant
                            if (ctx.styles.worldDetails.HasFlag(WorldDetails.GasGiant))
                            {
                                if (world.GasGiants > 0)
                                {
                                    solidBrush.Color = ctx.styles.worlds.textColor;
                                    RenderUtil.DrawGlyph(ctx.graphics, Glyph.Circle, styleRes, solidBrush, ctx.styles.GasGiantPosition.X, ctx.styles.GasGiantPosition.Y);
                                }
                            }
                            #endregion

                            #region Starport
                            if (ctx.styles.worldDetails.HasFlag(WorldDetails.Starport))
                            {
                                string starport = world.Starport.ToString();
                                DrawWorldLabel(ctx, worldTextBackgroundStyle, solidBrush, ctx.styles.worlds.textColor, ctx.styles.StarportPosition, styleRes.StarportFont, starport);
                            }
                            #endregion

                            #region UWP
                            if (renderUWP)
                            {
                                string uwp = world.UWP;
                                solidBrush.Color = ctx.styles.worlds.textColor;

                                ctx.graphics.DrawString(uwp, ctx.styles.hexNumber.Font, solidBrush, ctx.styles.StarportPosition.X, -ctx.styles.StarportPosition.Y, RenderUtil.StringFormatCentered);
                            }
                            #endregion

                            #region Bases
                            // TODO: Mask off background for glyphs
                            if (ctx.styles.worldDetails.HasFlag(WorldDetails.Bases))
                            {
                                string bases = world.Bases;

                                // Special case: Show Zho Naval+Military as diamond
                                if (world.BaseAllegiance == "Zh" && bases == "KM")
                                    bases = "Z";

                                // Base 1
                                bool bottomUsed = false;
                                if (bases.Length > 0)
                                {
                                    Glyph glyph = Glyph.FromBaseCode(world.BaseAllegiance, bases[0]);
                                    if (glyph.Printable)
                                    {
                                        PointF pt = ctx.styles.BaseTopPosition;
                                        if (glyph.Bias == Glyph.GlyphBias.Bottom)
                                        {
                                            pt = ctx.styles.BaseBottomPosition;
                                            bottomUsed = true;
                                        }

                                        solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                        RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, pt.X, pt.Y);
                                    }
                                }

                                // Base 2
                                if (bases.Length > 1)
                                {
                                    Glyph glyph = Glyph.FromBaseCode(world.LegacyAllegiance, bases[1]);
                                    if (glyph.Printable)
                                    {
                                        PointF pt = bottomUsed ? ctx.styles.BaseTopPosition : ctx.styles.BaseBottomPosition;
                                        solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                        RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, pt.X, pt.Y);
                                    }
                                }

                                // Research Stations
                                string rs;
                                if ((rs = world.ResearchStation) != null)
                                {
                                    Glyph glyph = Glyph.FromResearchCode(rs);
                                    solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                    RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, ctx.styles.BaseMiddlePosition.X, ctx.styles.BaseMiddlePosition.Y);
                                }
                                else if (world.IsReserve)
                                {
                                    Glyph glyph = Glyph.Reserve;
                                    solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                    RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, ctx.styles.BaseMiddlePosition.X, 0);
                                }
                                else if (world.IsPenalColony)
                                {
                                    Glyph glyph = Glyph.Prison;
                                    solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                    RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, ctx.styles.BaseMiddlePosition.X, 0);
                                }
                                else if (world.IsPrisonExileCamp)
                                {
                                    Glyph glyph = Glyph.ExileCamp;
                                    solidBrush.Color = glyph.IsHighlighted ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;
                                    RenderUtil.DrawGlyph(ctx.graphics, glyph, styleRes, solidBrush, ctx.styles.BaseMiddlePosition.X, 0);
                                }
                            }
                            #endregion
                        }

                        #region Disc
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.Type))
                        {
                            if (isPlaceholder)
                            {
                                DrawWorldLabel(ctx, ctx.styles.placeholder.textBackgroundStyle, solidBrush, ctx.styles.placeholder.textColor, ctx.styles.placeholder.position, ctx.styles.placeholder.Font, ctx.styles.placeholder.content);
                            }
                            else
                            {
                                if (world.Size <= 0)
                                {
                                    #region Asteroid-Belt
                                    if (ctx.styles.worldDetails.HasFlag(WorldDetails.Asteroids))
                                    {
                                        // Basic pattern, with probability varying per position:
                                        //   o o o
                                        //  o o o o
                                        //   o o o

                                        int[] lpx = { -2, 0, 2, -3, -1, 1, 3, -2, 0, 2 };
                                        int[] lpy = { -2, -2, -2, 0, 0, 0, 0, 2, 2, 2 };
                                        float[] lpr = { 0.5f, 0.9f, 0.5f, 0.6f, 0.9f, 0.9f, 0.6f, 0.5f, 0.9f, 0.5f };

                                        solidBrush.Color = ctx.styles.worlds.textColor;

                                        // Random generator is seeded with world location so it is always the same
                                        Random rand = new Random(world.Coordinates.X ^ world.Coordinates.Y);
                                        for (int i = 0; i < lpx.Length; ++i)
                                        {
                                            if (rand.NextDouble() < lpr[i])
                                            {
                                                float px = lpx[i] * 0.035f;
                                                float py = lpy[i] * 0.035f;

                                                float w = 0.04f + (float)rand.NextDouble() * 0.03f;
                                                float h = 0.04f + (float)rand.NextDouble() * 0.03f;

                                                // If necessary, add jitter here
                                                float dx = 0, dy = 0;

                                                ctx.graphics.DrawEllipse(solidBrush,
                                                    px + dx - w / 2, py + dy - h / 2, w, h);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        // Just a glyph
                                        solidBrush.Color = ctx.styles.worlds.textColor;
                                        RenderUtil.DrawGlyph(ctx.graphics, Glyph.DiamondX, styleRes, solidBrush, 0.0f, 0.0f);
                                    }
                                    #endregion
                                }
                                else
                                {
                                    XColor penColor, brushColor;
                                    ctx.styles.WorldColors(world, out penColor, out brushColor);

                                    if (!brushColor.IsEmpty)
                                    {
                                        solidBrush.Color = brushColor;
                                        ctx.graphics.DrawEllipse(solidBrush, -0.1f, -0.1f, 0.2f, 0.2f);
                                    }

                                    if (!penColor.IsEmpty)
                                    {
                                        ctx.styles.worldWater.pen.Apply(ref pen);
                                        pen.Color = penColor;
                                        ctx.graphics.DrawEllipse(pen, -0.1f, -0.1f, 0.2f, 0.2f);
                                    }
                                }
                            }
                        }
                        else
                        {
                            // Dotmap
                            solidBrush.Color = ctx.styles.worlds.textColor;
                            ctx.graphics.DrawEllipse(solidBrush, -0.2f, -0.2f, 0.4f, 0.4f);
                        }
                        #endregion
                    }
                }
                else // ctx.styles.useWorldImages
                {
                    float imageRadius = ((world.Size <= 0) ? 0.6f : (0.3f * (world.Size / 5.0f + 0.2f))) / 2;
                    float decorationRadius = imageRadius;

                    if (layer == WorldLayer.Background)
                    {
                        #region Disc
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.Type))
                        {
                            if (isPlaceholder)
                            {
                                DrawWorldLabel(ctx, ctx.styles.placeholder.textBackgroundStyle, solidBrush, ctx.styles.placeholder.textColor, ctx.styles.placeholder.position, ctx.styles.placeholder.Font, ctx.styles.placeholder.content);
                            }
                            else if (world.Size <= 0)
                            {
                                const float scaleX = 1.5f;
                                const float scaleY = 1.0f;
                                XImage img = s_worldImages["Belt"];

                                lock (img)
                                {
                                    ctx.graphics.DrawImage(img, -imageRadius * scaleX, -imageRadius * scaleY, imageRadius * 2 * scaleX, imageRadius * 2 * scaleY);
                                }
                            }
                            else
                            {
                                XImage img;
                                switch (world.Hydrographics)
                                {
                                    default:
                                    case 0x0: img = s_worldImages["Hyd0"]; break;
                                    case 0x1: img = s_worldImages["Hyd1"]; break;
                                    case 0x2: img = s_worldImages["Hyd2"]; break;
                                    case 0x3: img = s_worldImages["Hyd3"]; break;
                                    case 0x4: img = s_worldImages["Hyd4"]; break;
                                    case 0x5: img = s_worldImages["Hyd5"]; break;
                                    case 0x6: img = s_worldImages["Hyd6"]; break;
                                    case 0x7: img = s_worldImages["Hyd7"]; break;
                                    case 0x8: img = s_worldImages["Hyd8"]; break;
                                    case 0x9: img = s_worldImages["Hyd9"]; break;
                                    case 0xA: img = s_worldImages["HydA"]; break;
                                }
                                if (img != null)
                                {
                                    lock (img)
                                    {
                                        ctx.graphics.DrawImage(img, -imageRadius, -imageRadius, imageRadius * 2, imageRadius * 2);
                                    }
                                }
                            }
                        }
                        else
                        {
                            // Dotmap
                            solidBrush.Color = ctx.styles.worlds.textColor;
                            ctx.graphics.DrawEllipse(solidBrush, -0.2f, -0.2f, 0.4f, 0.4f);
                        }
                        #endregion
                    }

                    if (isPlaceholder)
                        return;

                    if (layer == WorldLayer.Foreground)
                    {
                        #region Zone
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.Zone))
                        {
                            if (world.IsAmber || world.IsRed || world.IsBlue)
                            {
                                PenInfo pi =
                                    world.IsAmber ? ctx.styles.amberZone.pen :
                                    world.IsRed ? ctx.styles.redZone.pen : ctx.styles.blueZone.pen;
                                pi.Apply(ref pen);

                                // TODO: Try and accomplish this using dash pattern
                                decorationRadius += 0.1f;
                                ctx.graphics.DrawArc(pen, -decorationRadius, -decorationRadius, decorationRadius * 2, decorationRadius * 2, 5, 80);
                                ctx.graphics.DrawArc(pen, -decorationRadius, -decorationRadius, decorationRadius * 2, decorationRadius * 2, 95, 80);
                                ctx.graphics.DrawArc(pen, -decorationRadius, -decorationRadius, decorationRadius * 2, decorationRadius * 2, 185, 80);
                                ctx.graphics.DrawArc(pen, -decorationRadius, -decorationRadius, decorationRadius * 2, decorationRadius * 2, 275, 80);
                            }
                        }
                        #endregion

                        #region GasGiant
                        if (ctx.styles.worldDetails.HasFlag(WorldDetails.GasGiant))
                        {
                            if (world.GasGiants > 0)
                            {
                                decorationRadius += 0.1f;
                                const float symbolRadius = 0.05f;
                                solidBrush.Color = ctx.styles.worlds.textHighlightColor; ;
                                ctx.graphics.DrawEllipse(solidBrush, decorationRadius - symbolRadius, 0.0f - symbolRadius, symbolRadius * 2, symbolRadius * 2);
                            }
                        }
                        #endregion

                        #region UWP
                        if (renderUWP)
                        {
                            string uwp = world.UWP;
                            solidBrush.Color = ctx.styles.worlds.textColor;

                            using (RenderUtil.SaveState(ctx.graphics))
                            {
                                XMatrix uwpMatrix = new XMatrix();
                                uwpMatrix.TranslatePrepend(decorationRadius, 0.0f);
                                uwpMatrix.ScalePrepend(ctx.styles.worlds.textStyle.Scale.Width, ctx.styles.worlds.textStyle.Scale.Height);
                                uwpMatrix.Multiply(uwpMatrix, XMatrixOrder.Prepend);
                                ctx.graphics.DrawString(uwp, ctx.styles.hexNumber.Font, solidBrush, ctx.styles.StarportPosition.X, -ctx.styles.StarportPosition.Y, RenderUtil.StringFormatCenterLeft);
                            }
                        }
                        #endregion

                        #region Name
                        if (renderName)
                        {
                            string name = world.Name;
                            if (isHiPop)
                                name = name.ToUpperInvariant();

                            using (RenderUtil.SaveState(ctx.graphics))
                            {
                                Color textColor = (isCapital && ctx.styles.worldDetails.HasFlag(WorldDetails.Highlight))
                                    ? ctx.styles.worlds.textHighlightColor : ctx.styles.worlds.textColor;

                                if (ctx.styles.worlds.textStyle.Uppercase)
                                    name = name.ToUpper();

                                decorationRadius += 0.1f;
                                XMatrix imageMatrix = new XMatrix();
                                imageMatrix.TranslatePrepend(decorationRadius, 0.0f);
                                imageMatrix.ScalePrepend(ctx.styles.worlds.textStyle.Scale.Width, ctx.styles.worlds.textStyle.Scale.Height);
                                imageMatrix.TranslatePrepend(ctx.graphics.MeasureString(name, ctx.styles.worlds.Font).Width / 2, 0.0f); // Left align
                                ctx.graphics.MultiplyTransform(imageMatrix, XMatrixOrder.Prepend);

                                DrawWorldLabel(ctx, ctx.styles.worlds.textBackgroundStyle, solidBrush, textColor, ctx.styles.worlds.textStyle.Translation, ctx.styles.worlds.Font, name);
                            }
                        }
                        #endregion
                    }
                }
            }
        }
        public void PaintWorld(WorldLayer layer)
        {
            var Skills = Hud.Game.Actors;

            foreach (var skill in Skills)
            {
                switch (skill.SnoActor.Sno)
                {
                case ActorSnoEnum._gluttony_gascloud_proxy:
                    GhomTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._zoltunkulle_energytwister:
                    TornadoDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    TornadoTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._zoltunkulle_slowtime_bubble:
                    SlowTimeDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    SlowTimeTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._x1_unique_monster_generic_aoe_dot_fire_10foot:
                    FirePentagramDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    FirePentagramTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._x1_adria_geyser:
                case ActorSnoEnum._x1_adria_geyser_pending:
                    GeyserTethrysDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    GeyserTethrysTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._p4_lr_boss_sandmonster_turret:
                    SandmonsterTurretDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    SandmonsterTurretTimerDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._p4_ratking_ratballmonster:
                    RatSwarmDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._x1_lr_boss_malletdemon_fallingrocks:
                case ActorSnoEnum._x1_pand_cellar_fallingrock:
                case ActorSnoEnum._a2dun_zolt_random_fallingrocks_c:
                    FallingRocksDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._morluspellcaster_meteor_pending:
                case ActorSnoEnum._morluspellcaster_meteor_impact:
                case ActorSnoEnum._morluspellcaster_meteor_afterburn:
                    MeteorDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._p2_westmarchbrute_leap_telegraph:
                case ActorSnoEnum._x1_westmarchbrute_b_leap_telegraph:
                    BloodmawDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._x1_westmarchbrute_leap_telegraph:
                    BruteLeapDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._skeletonmage_fire_groundpool:
                    SmolderingPoolDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;

                case ActorSnoEnum._x1_bog_bear_trap:
                case ActorSnoEnum._x1_bog_bear_trap_projectile_lobbed:
                    BogBearTrapDecorator.Paint(layer, skill, skill.FloorCoordinate, "夹子");
                    break;

                case ActorSnoEnum._x1_monsteraffix_teleportmines:
                    WormholeDecorator.Paint(layer, skill, skill.FloorCoordinate, string.Empty);
                    break;
                }
            }
        }
Exemplo n.º 23
0
        public void PaintWorld(WorldLayer layer)
        {
            if (ShowSkeletonOthers)
            {
                var players     = Hud.Game.Players.Where(player => !player.IsMe && player.HeroClassDefinition.HeroClass == HeroClass.Necromancer && player.CoordinateKnown && Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && (player.HeadStone == null));
                var OtherActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId != Hud.Game.Me.SummonerId && SkeletonActorSNOs.Contains(EachActor.SnoActor.Sno));

                foreach (var player in players)
                {
                    var IsActive = player.Powers.BuffIsActive(SkeletonSkillSNO, 0);
                    foreach (var OtherActor in OtherActors)
                    {
                        if (OtherActor.SummonerAcdDynamicId == player.SummonerId)
                        {
                            SkeletonOtherDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SkeletonOthers);
                            if (IsActive)
                            {
                                SkeletonActiveDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SkeletonOthers);
                            }
                        }
                    }
                }
            }
            if (ShowSimulacrumOthers)
            {
                var players     = Hud.Game.Players.Where(player => !player.IsMe && player.HeroClassDefinition.HeroClass == HeroClass.Necromancer && player.CoordinateKnown && Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && (player.HeadStone == null));
                var OtherActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId != Hud.Game.Me.SummonerId && SimulacrumActorSNOs.Contains(EachActor.SnoActor.Sno));

                foreach (var player in players)
                {
                    var IsActive = player.Powers.BuffIsActive(SimulacrumSkillSNO, 0);
                    foreach (var OtherActor in OtherActors)
                    {
                        if (OtherActor.SummonerAcdDynamicId == player.SummonerId)
                        {
                            SimulacrumOtherDecorator.Paint(layer, OtherActor, OtherActor.FloorCoordinate, Label_SimulacrumOthers);
                        }
                    }
                }
            }

            if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Necromancer)
            {
                return;
            }

            // For Skeleton Melee, only when equipping the skill
            var skill = Hud.Game.Me.Powers.UsedSkills.FirstOrDefault(s => s.SnoPower.Sno == Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno);

            if (skill != null)
            {
                var activeSkeleton = Hud.Game.Me.Powers.BuffIsActive(SkeletonSkillSNO, 0);
                var SkeletonActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && SkeletonActorSNOs.Contains(EachActor.SnoActor.Sno));

                if (ShowSkeleton)
                {
                    SkeletonCount = SkeletonActors.Count();
                    foreach (var EachActor in SkeletonActors)
                    {
                        SkeletonDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, null);
                        if (activeSkeleton)
                        {
                            SkeletonActiveDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Skeleton);
                        }
                    }
                }

                if (activeSkeleton || skill.Rune == 3)
                {
                    IAttribute attr;
                    switch (skill.Rune)
                    {
                    case 0: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_A; break;

                    case 1: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_B; break;

                    case 2: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_C; break;

                    case 3: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_D; break;

                    case 4: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_E; break;

                    default: attr = Hud.Sno.Attributes.Power_Buff_4_Visual_Effect_None; break;
                    }

                    var TargetonScreen = false;
                    foreach (IMonster monster in Hud.Game.AliveMonsters)
                    {
                        if (monster.GetAttributeValueAsUInt(attr, Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno, 2) == 1)
                        {
                            TargetonScreen = true;

                            if (ActiveTarget == null)
                            {
                                ActiveTarget = monster;
                                if (Hud.Game.Me.Powers.BuffIsActive(476584, 0))
                                {
                                    ResetRinger(false);
                                    StartRinger();
                                }
                            }
                            else if (ActiveTarget != monster)
                            {
                                ActiveTarget = monster;
                                if (Hud.Game.Me.Powers.BuffIsActive(476584, 0))
                                {
                                    ResetRinger(true);
                                    StartRinger();
                                }
                            }

                            var TargetisElite = (monster.IsElite && monster.SummonerAcdDynamicId == 0 && monster.Rarity != ActorRarity.RareMinion);
                            if (TargetisElite)
                            {
                                SkeletonTargetEliteDecorator.Paint(layer, null, monster.FloorCoordinate, null);
                            }
                            else if (!TargetOnEliteOnly)
                            {
                                SkeletonTargetDecorator.Paint(layer, null, monster.FloorCoordinate, null);
                            }

                            break;
                        }
                    }

                    if (Hud.Game.Me.Powers.BuffIsActive(476584, 0))
                    {
                        if (SkeletonCount == 0)
                        {
                            ResetRinger(true);
                            StartRinger();
                        }
                        if (!TargetonScreen)
                        {
                            ActiveTarget = null;
                            ResetRinger(false);
                        }
                    }
                }
                else
                {
                    ResetRinger(true);
                }
            }
            else
            {
                SkeletonCount = 0;
            }

            // For Skeleton Mages, only when equipping the skill
            if (ShowMage && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == MageSkillSNO) != null)
            {
                var MageActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && MageActorSNOs.Contains(EachActor.SnoActor.Sno));
                MageCount = MageActors.Count();

                foreach (var EachActor in MageActors)
                {
                    MageDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Mage);
                }
            }
            else
            {
                MageCount = 0;
            }


            // For Golem, only when equipping the skill
            if (ShowGolem && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == GolemSkillSNO) != null)
            {
                var GolemActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && GolemActorSNOs.Contains(EachActor.SnoActor.Sno));

                foreach (var EachActor in GolemActors)
                {
                    GolemDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Golem);
                }
            }

            // For Simulacrum, only when equipping the skill
            if (ShowSimulacrum && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == SimulacrumSkillSNO) != null)
            {
                var SimulacrumActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && SimulacrumActorSNOs.Contains(EachActor.SnoActor.Sno));

                foreach (var EachActor in SimulacrumActors)
                {
                    SimulacrumDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Simulacrum);
                }
            }

            // For Revive, only when equipping the skill
            if (ShowRevive && Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == ReviveSkillSNO) != null)
            {
                var ReviveActors = Hud.Game.Actors.Where(EachActor => EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && EachActor.SnoActor.Sno.ToString().Contains("_p6_necro_revive"));
                ReviveCount = ReviveActors.Count();

                foreach (var EachActor in ReviveActors)
                {
                    ReviveDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, Label_Revive);
                }
            }
            else
            {
                ReviveCount = 0;
            }
        }
Exemplo n.º 24
0
        public void PaintWorld(WorldLayer layer)
        {
            string NemesisMessage   = string.Empty;
            string MyNemesisMessage = string.Empty;
            int    MyNemesisCount   = 0;

            foreach (var player in Hud.Game.Players.OrderBy(p => p.PortraitIndex))
            {
                if (player == null)
                {
                    continue;
                }
                var Nemo = player.Powers.GetBuff(318820);
                if (Nemo == null || !Nemo.Active)
                {
                }
                else
                {
                    if (player.IsMe)
                    {
                        MyNemesisCount++;
                    }
                    else
                    {
                        if (NemesisMessage == string.Empty)
                        {
                            NemesisMessage += Environment.NewLine + player.BattleTagAbovePortrait;
                        }
                        else
                        {
                            NemesisMessage += Environment.NewLine + " or " + player.BattleTagAbovePortrait;
                        }
                    }
                }
            }


            if (NemesisMessage != string.Empty)
            {
                NemesisMessage = "Leave for" + NemesisMessage;
            }
            if (MyNemesisCount == 1)
            {
                NemesisMessage = "HIT ME!";
            }

            var shrines = Hud.Game.Shrines.Where(x => !x.IsDisabled && !x.IsOperated);

            foreach (var shrine in shrines)
            {
                if (ShowAllWhenHealthIsUnder40 && Hud.Game.Me.Defense.HealthPct < (float)40)
                {
                    ShowHealingWells = true; ShowPoolOfReflection = true;
                }
                else if (ShowAllWhenHealthIsUnder40 && Hud.Game.Me.Defense.HealthPct >= (float)40)
                {
                    ShowHealingWells = false; ShowPoolOfReflection = false;
                }

                if (shrine.Type == ShrineType.HealingWell && ShowHealingWells == false)
                {
                    continue;
                }
                if (shrine.Type == ShrineType.PoolOfReflection && ShowPoolOfReflection == false)
                {
                    continue;
                }
                if (shrine.Type == ShrineType.HealingWell && ShowHealingWells == true || shrine.Type == ShrineType.PoolOfReflection && ShowPoolOfReflection == true)
                {
                    NemesisMessage = string.Empty;
                }

                var shrineName = (ShrineCustomNames[shrine.Type] != string.Empty) ? ShrineCustomNames[shrine.Type] : shrine.SnoActor.NameLocalized;
                ShrineDecorators[shrine.Type].Paint(layer, shrine, shrine.FloorCoordinate, shrineName);

                var ShrineNameShort = (ShrineCustomNamesShort[shrine.Type] != string.Empty) ? ShrineCustomNamesShort[shrine.Type] : shrine.SnoActor.NameLocalized;

                switch (shrine.Type)
                {
                case ShrineType.BlessedShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u26E8 -25% damage received \u26E8";
                    break;

                case ShrineType.EnlightenedShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "+25% EXP gain";
                    break;

                case ShrineType.FortuneShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u2728 +25% magic & gold find \u2728";
                    break;

                case ShrineType.FrenziedShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u2694 +25% attack speed \u2694";
                    break;

                case ShrineType.EmpoweredShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "+100% resource gain" + Environment.NewLine + "\u231A -50% cooldown time \u231A";
                    break;

                case ShrineType.FleetingShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\uD83C\uDFC3 +25% movement speed \uD83C\uDFC3" + Environment.NewLine + "+20yd pickup radius";
                    break;

                case ShrineType.PowerPylon:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\uD83D\uDCAA +400% damage dealt \uD83D\uDCAA";
                    break;

                case ShrineType.ConduitPylon:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u26A1 HIGH VOLTAGE \u26A1";
                    break;

                case ShrineType.ChannelingPylon:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u231A -75% cooldown time \u231A" + Environment.NewLine + "No resource cost";
                    break;

                case ShrineType.ShieldPylon:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "60s of invulnerability";
                    break;

                case ShrineType.SpeedPylon:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u2694 +30% attack speed \u2694" + Environment.NewLine + "\uD83C\uDFC3 +80% movement speed \uD83C\uDFC3";
                    break;

                case ShrineType.PoolOfReflection:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "+25% EXP gain"; NemesisMessage = string.Empty;
                    break;

                case ShrineType.BanditShrine:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\uD83D\uDCB0 GOBLINS! \uD83D\uDCB0";
                    break;

                case ShrineType.HealingWell:
                    ShrineNameShort = ShrineNameShort + Environment.NewLine + "\u2764 restores life \u2764"; NemesisMessage = string.Empty;
                    break;
                }

                ShrineShortDecorators[shrine.Type].Paint(layer, shrine, shrine.FloorCoordinate, ShrineNameShort);
                if (shrine.FloorCoordinate.Offset(0, 0, 10).IsOnScreen())
                {
                    LeaveMessageDecorator.Paint(layer, null, shrine.FloorCoordinate.Offset(0, 0, 10), NemesisMessage);
                }
            }

            var riftPylonSpawnPoints = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._markerlocation_tieredriftpylon);  //  428690

            foreach (var actor in riftPylonSpawnPoints)
            {
                PossibleRiftPylonDecorators.Paint(layer, actor, actor.FloorCoordinate, (PossibleRiftPylonName != string.Empty) ? PossibleRiftPylonName : "Pylon?");
            }
        }
Exemplo n.º 25
0
        public void PaintWorld(WorldLayer layer)
        {
            var  hedPlugin = Hud.GetPlugin <HotEnablerDisablerPlugin>();
            bool GoOn      = hedPlugin.CanIRun(Hud.Game.Me, this.GetType().Name);

            if (!GoOn)
            {
                return;
            }

            bool StrickenActive  = false;
            var  jewelsLocations = Hud.Game.Items.Where(x => x.Location == ItemLocation.LeftRing || x.Location == ItemLocation.RightRing || x.Location == ItemLocation.Neck);

            foreach (var StrickenLocation in jewelsLocations)
            {
                if (StrickenLocation.SocketCount != 1 || StrickenLocation.ItemsInSocket == null)
                {
                    continue;
                }
                var Stricken = StrickenLocation.ItemsInSocket.FirstOrDefault();
                if (Stricken == null)
                {
                    continue;
                }
                if (Stricken.SnoItem.Sno == 3249948847)
                {
                    StrickenActive = true; StrickenRank = Stricken.JewelRank; break;
                }
                else
                {
                    continue;
                }
            }


            if (StrickenActive == false)
            {
                return;
            }


            float gemMaths = 0.8f + (0.01f * (float)StrickenRank);
            var   Texture  = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Gem_018_x1);
            var   monsters = Hud.Game.Monsters.OrderBy(i => i.NormalizedXyDistanceToMe);

            foreach (var monster in monsters)
            {
                if (ElitesnBossOnly && !monster.IsElite)
                {
                    continue;
                }
                if (BossOnly && monster.Rarity.ToString() != "Boss")
                {
                    continue;
                }
                var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();

                if (monster.IsAlive)
                {
                    Tuple <double, int> valuesOut;
                    if (MonsterStatus.TryGetValue(monster.AcdId, out valuesOut))
                    {
                        double Health     = monster.CurHealth;
                        double prevHealth = valuesOut.Item1;
                        int    prevStacks = valuesOut.Item2;

                        if (prevHealth > Health && Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2) && monsterCount == 0 && !cooldown)
                        {
                            int Stacks = (int)(prevStacks + 1);
                            Tuple <double, int> updateValues = new Tuple <double, int>(monster.CurHealth, Stacks);
                            MonsterStatus[monster.AcdId] = updateValues;
                            monsterCount++;
                            cooldown = true;
                        }

                        else if (!Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2) && cooldown)
                        {
                            cooldown     = false;
                            monsterCount = 0;
                            if (prevHealth > Health)
                            {
                                int Stacks = (int)(prevStacks);
                                Tuple <double, int> updateValues = new Tuple <double, int>(monster.CurHealth, Stacks);
                                MonsterStatus[monster.AcdId] = updateValues;
                            }
                        }


                        if (prevStacks > 0)
                        {
                            int bossPerc = 0;
                            if (monster.SnoMonster.Priority == MonsterPriority.boss)
                            {
                                bossPerc = 25;
                            }
                            else
                            {
                                bossPerc = 0;
                            }
                            float  StrickenDamagePercent = (float)(bossPerc + (prevStacks * gemMaths));
                            string percentDamageBonus    = "+" + StrickenDamagePercent.ToString("0.00") + "%";
                            Texture.Draw(monsterScreenCoordinate.X + offsetX, monsterScreenCoordinate.Y + offsetY, propSquare, propSquare);
                            StrickenStackDecorator.TextFunc   = () => prevStacks.ToString();
                            StrickenPercentDecorator.TextFunc = () => percentDamageBonus;
                            StrickenStackDecorator.Paint(monsterScreenCoordinate.X + offsetX, monsterScreenCoordinate.Y + offsetY, propSquare, propSquare, HorizontalAlign.Center);
                            StrickenPercentDecorator.Paint(monsterScreenCoordinate.X + offsetX, (float)(monsterScreenCoordinate.Y + offsetY + (propSquare / 2.5)), propSquare, propSquare, HorizontalAlign.Right);
                            if (cooldown)
                            {
                                StrickenPercentDecorator.TextFunc = () => "\u231B";
                                StrickenPercentDecorator.Paint((float)(monsterScreenCoordinate.X + offsetX + (propSquare / 2)), monsterScreenCoordinate.Y + offsetY, propSquare, propSquare, HorizontalAlign.Center);
                            }
                        }
                    }
                    else
                    {
                        Tuple <double, int> valuesIn = new Tuple <double, int>(monster.CurHealth, (int)(0));
                        MonsterStatus.Add(monster.AcdId, valuesIn);
                    }
                }
                else
                {
                    MonsterStatus.Remove(monster.AcdId);
                }
            }
        }
        public void PaintWorld(WorldLayer layer)
        {
            if (layer != WorldLayer.Ground)
            {
                return;
            }

            var groundRect          = Hud.Window.GroundRectangle;
            var padding             = Hud.Window.Size.Height * Padding;
            var screenBorderPadding = Hud.Window.Size.Height * ScreenBorderPadding;

            foreach (var kvp in _registeredLabels)
            {
                var coord = kvp.Key;
                var list  = kvp.Value;

                var tw   = 0.0f;
                var sc   = coord.ToScreenCoordinate(true, true);
                var maxH = 0.0f;

                foreach (var regLabel in list)
                {
                    var layout = regLabel.Decorator.TextFont.GetTextLayout(regLabel.Text);
                    var w      = layout.Metrics.Width + padding * 6;
                    tw += w;
                    if (layout.Metrics.Height > maxH)
                    {
                        maxH = layout.Metrics.Height;
                    }
                }

                var forceOnScreen = list.Any(regLabel => regLabel.Decorator.ForceOnScreen);

                var x = sc.X - tw / 2;
                if (forceOnScreen)
                {
                    x = Math.Max(screenBorderPadding, Math.Min(x, groundRect.Width - screenBorderPadding - tw));
                }

                foreach (var regLabel in list)
                {
                    var layout = regLabel.Decorator.TextFont.GetTextLayout(regLabel.Text);
                    var w      = layout.Metrics.Width + padding * 6;
                    var h      = layout.Metrics.Height + padding * 2;

                    var y = regLabel.Decorator.CenterBaseLine ? sc.Y - layout.Metrics.Height / 2 : sc.Y + (maxH - layout.Metrics.Height) / 2;

                    if (forceOnScreen)
                    {
                        y = Math.Max(screenBorderPadding, Math.Min(y, groundRect.Bottom - screenBorderPadding - h));
                    }

                    var rect = new SharpDX.RectangleF(x + regLabel.Decorator.OffsetX, y + regLabel.Decorator.OffsetY - padding, w, h);

                    if (regLabel.Decorator.BackgroundTexture1 != null)
                    {
                        regLabel.Decorator.BackgroundTexture1.Draw(rect, regLabel.Decorator.BackgroundTextureOpacity1);
                    }

                    if (regLabel.Decorator.BackgroundTexture2 != null)
                    {
                        regLabel.Decorator.BackgroundTexture2.Draw(rect, regLabel.Decorator.BackgroundTextureOpacity2);
                    }

                    if (regLabel.Decorator.BackgroundBrush != null)
                    {
                        regLabel.Decorator.BackgroundBrush.DrawRectangle(rect);
                    }

                    regLabel.Decorator.TextFont.DrawText(layout, x + regLabel.Decorator.OffsetX + padding * 3, y + regLabel.Decorator.OffsetY);

                    if (regLabel.Decorator.BorderBrush != null)
                    {
                        regLabel.Decorator.BorderBrush.DrawRectangle(rect);
                    }

                    x += w;
                }
            }

            _registeredLabels.Clear();
        }
Exemplo n.º 27
0
        public void PaintWorld(WorldLayer layer)
        {
            //   var hedPlugin = Hud.GetPlugin<HotEnablerDisablerPlugin>();
            //   bool GoOn = hedPlugin.CanIRun(Hud.Game.Me,this.GetType().Name);
            //   if (!GoOn) return;

            bool ZeiActive = false;

            ZeiRank = 0;
            var jewelsLocations = Hud.Game.Items.Where(x => x.Location == ItemLocation.LeftRing || x.Location == ItemLocation.RightRing || x.Location == ItemLocation.Neck);

            foreach (var ZeiLocation in jewelsLocations)
            {
                if (ZeiLocation.SocketCount != 1 || ZeiLocation.ItemsInSocket == null)
                {
                    continue;
                }
                var Zei = ZeiLocation.ItemsInSocket.FirstOrDefault();
                if (Zei == null)
                {
                    continue;
                }
                if (Zei.SnoItem.Sno == 3249733225)
                {
                    ZeiActive = true; ZeiRank = Zei.JewelRank; break;
                }
                else
                {
                    continue;
                }
            }


            if (ZeiActive == false)
            {
                if (TargetForAll)
                {
                    if (Hud.Game.IsInTown)
                    {
                        return;
                    }
                    goto TargetOnMinimap;
                }
                else
                {
                    return;
                }
            }



            if (permanentCircle)
            {
                if (Hud.Game.IsInTown)
                {
                    return;
                }
            }
            else
            {
                if (!Hud.Game.Me.InCombat)
                {
                    goto MiniMapCircle;
                }
                else
                {
                    goto TargetOnMinimap;
                }
            }


            OutlineBrush.DrawWorldEllipse(50, -1, Hud.Game.Me.FloorCoordinate);

            var Smonster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;

            if ((Smonster == null))
            {
                return;
            }

            var monsters = Hud.Game.AliveMonsters.Where(monster => monster.Attackable && monster == Smonster);

            foreach (var monster in monsters)
            {
                if (ElitesOnlyNumbers && !monster.IsElite)
                {
                    continue;
                }
                var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();
                percentDamageBonus = "";
                float gemMaths = 4f + (0.08f * (float)ZeiRank);

                if (monster.NormalizedXyDistanceToMe < 50)
                {
                    percentDamageBonus = "+" + (gemMaths * ((float)monster.NormalizedXyDistanceToMe / 10)).ToString("0.00") + "%";
                }
                else
                {
                    percentDamageBonus = "+" + (gemMaths * 5f).ToString("0.00") + "% Max!";
                }

                float visibleX;
                float visibleY;
                float MidX = (float)midX;
                float MidY = (float)midY;

                if (monsterScreenCoordinate.X > MidX)
                {
                    visibleX = monsterScreenCoordinate.X - 60f;
                }
                else
                {
                    visibleX = monsterScreenCoordinate.X + 50f;
                }
                if (monsterScreenCoordinate.Y > MidY)
                {
                    visibleY = monsterScreenCoordinate.Y - 150f;
                }
                else
                {
                    visibleY = monsterScreenCoordinate.Y + 50f;
                }

                var layout = TextFont.GetTextLayout(percentDamageBonus);
                TextFont.DrawText(layout, visibleX, visibleY);
            }

MiniMapCircle:
            if (Hud.Game.IsInTown)
            {
                return;
            }
            ZeiMiniMapDecorator.Paint(layer, null, Hud.Game.Me.FloorCoordinate, null);
TargetOnMinimap:
            var cursorScreenCoord = Hud.Window.CreateScreenCoordinate(Hud.Window.CursorX, Hud.Window.CursorY);
            var visorWorldCoord = cursorScreenCoord.ToWorldCoordinate();

            MiniMapVisorDecorator.Paint(layer, null, visorWorldCoord, null);
        }
Exemplo n.º 28
0
        public void PaintWorld(WorldLayer layer)
        {
            var monsters = Hud.Game.AliveMonsters.Where(m => m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare || m.Rarity == ActorRarity.RareMinion);

            foreach (var monster in monsters)
            {
                if (!ShowIllusionistCloneDecorator && monster.SummonerAcdDynamicId != 0)
                {
                    continue;
                }

                var dangerousAffixes = monster.AffixSnoList
                                       .Join(Affixes,
                                             snoAffix => snoAffix.Affix,
                                             dangerous => dangerous.Key,
                                             (snoAffix, dangerous) => dangerous.Value)
                                       .ToList();

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

                dangerousAffixes.Sort((a, b) => - a.Priority.CompareTo(b.Priority));

                switch (monster.Rarity)
                {
                case ActorRarity.Champion:
                case ActorRarity.Rare:
                    dangerousAffixes.First().EliteDecorators.Paint(layer, monster, monster.FloorCoordinate, null);

                    if (dangerousAffixes.Count == 1)
                    {
                        DrawAffixName(monster, dangerousAffixes.First());
                    }
                    else if (dangerousAffixes.Count > 1)
                    {
                        DrawAffixNames(monster, dangerousAffixes, GetCombinedLabelsText(monster, dangerousAffixes));
                    }
                    break;

                case ActorRarity.RareMinion:
                    var minionAffix = dangerousAffixes.FirstOrDefault(a => a.ShowMinionDecorators);

                    if (minionAffix != null)
                    {
                        minionAffix.MinionDecorators.Paint(layer, monster, monster.FloorCoordinate, null);
                    }

                    dangerousAffixes = dangerousAffixes.Where(a => a.ShowMinionAffixesNames).ToList();

                    if (dangerousAffixes.Count == 1)
                    {
                        DrawAffixName(monster, dangerousAffixes.First());
                    }
                    else if (dangerousAffixes.Count > 1)
                    {
                        DrawAffixNames(monster, dangerousAffixes, GetCombinedLabelsText(monster, dangerousAffixes));
                    }
                    break;
                }
            }
        }
Exemplo n.º 29
0
        public void PaintWorld(WorldLayer layer)
        {
            foreach (var marker in Hud.Game.Markers)
            {
                if (showDirectionLine && marker.SnoActor != null)
                {
                    if (marker.SnoActor.Code.Contains("Boss"))
                    {
                        BossDirectionLineDecorator.ToggleDecorators <GroundLabelDecorator>(!marker.FloorCoordinate.IsOnScreen());                        // do not display ground labels when the marker is on the screen
                        BossDirectionLineDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                    }
                }
            }
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Boss)
                {
                    if (showDirectionLine && showMiniMapLine)
                    {
                        BossDirectionLineDecorator.ToggleDecorators <GroundLabelDecorator>(!monster.FloorCoordinate.IsOnScreen()); // do not display ground labels when the marker is on the screen
                        BossDirectionLineDecorator.Paint(layer, null, monster.FloorCoordinate, null);
                    }
                    if (showDirectionLine && showGroundLine)
                    {
                        IScreenCoordinate boss = Hud.Window.CreateScreenCoordinate(monster.FloorCoordinate.ToScreenCoordinate().X, monster.FloorCoordinate.ToScreenCoordinate().Y);
                        Hud.Render.CreateBrush(192, 255, 255, 55, -1).DrawLine(boss.X, boss.Y, Hud.Game.Me.ScreenCoordinate.X, Hud.Game.Me.ScreenCoordinate.Y + 60, 1.0f);
                    }
                    if ((showCCoffMessage) && (!monster.Frozen && !monster.Chilled && !monster.Slow && !monster.Stunned && !monster.Blind))
                    {
                        var    CCofftime     = (Hud.Game.CurrentGameTick - CCoffStarttick) / 60.0d;
                        String CCofftimetext = "CC 없음 " + Math.Truncate(CCofftime) + "초";;
                        if (!CCofftimerRunning)
                        {
                            CCoffStarttick    = Hud.Game.CurrentGameTick;
                            CCofftimerRunning = true;
                        }
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), CCofftimetext);
                    }

                    if ((showCCoffMessage) && (monster.Frozen || monster.Chilled || monster.Slow || monster.Stunned || monster.Blind))
                    {
                        if (CCofftimerRunning)
                        {
                            CCofftimerRunning = false;
                        }
                    }
                    string data1 = "";
                    if (monster.Frozen && showCC)
                    {
                        data1 += "빙결";
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Chilled && showCC)
                    {
                        data1 += " 오한";
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Slow && showCC)
                    {
                        data1 += " 느림";
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Stunned && showCC)
                    {
                        data1 += " 기절";
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Blind && showCC)
                    {
                        data1 += " 실명";
                        BossCCDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Locust && showDebuff)
                    {
                        data1 += " 메뚜기";
                        BossDebuffDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Haunted && showDebuff)
                    {
                        data1 += " 혼출";
                        BossDebuffDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Palmed && showDebuff)
                    {
                        data1 += " 폭장";
                        BossDebuffDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.MarkedForDeath && showDebuff)
                    {
                        data1 += " 죽표";
                        BossDebuffDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                    if (monster.Strongarmed && showDebuff)
                    {
                        data1 += " 팔씨름";
                        BossDebuffDecorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offset), data1);
                    }
                }
            }
        }
Exemplo n.º 30
0
        public void PaintWorld(WorldLayer layer)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (!Hud.Game.IsInTown)
            {
                return;
            }
            if (Hud.Game.NumberOfPlayersInGame == 1)
            {
                return;
            }

            var bannerAround = Hud.Game.Actors.Any(x => x.SnoActor.Sno == ActorSnoEnum._invisboxcollision_flippy && !x.IsDisabled && !x.IsOperated && x.IsOnScreen); // 375094

            if (!bannerAround)
            {
                return;
            }

            foreach (var player in Hud.Game.Players)
            {
                if (player == null)
                {
                    continue;
                }
                if (player.IsInTown && !SeePlayersInTown)
                {
                    continue;
                }
                if (SeePlayersInTown && player.IsMe)
                {
                    continue;
                }
                string battleTag = player.BattleTagAbovePortrait;
                if (battleTag == null)
                {
                    continue;
                }
                TagDecorator.TextFunc = () => battleTag.ToString();
                var currentAct   = Hud.Game.Me.SnoArea.Act;
                var playerIndex  = player.Index;
                var HeroTexture  = Hud.Texture.GetTexture(890155253);
                var ScreenWidth  = Hud.Window.Size.Width;
                var ScreenHeight = Hud.Window.Size.Height;


                if (!coordinates.ContainsKey(currentAct))
                {
                    return;
                }
                if (!coordinates[currentAct].ContainsKey(playerIndex))
                {
                    return;
                }


                if (player.HeroClassDefinition.HeroClass.ToString() == "Barbarian")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3921484788);                                                // male/female can't be determined, let's keep it for later...
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1030273087);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Crusader")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3742271755);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(3435775766);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "DemonHunter")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3785199803);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2939779782);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Monk")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(2227317895);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2918463890);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Necromancer")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3285997023);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(473831658);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "WitchDoctor")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3925954876);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1603231623);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Wizard")
                {
                    if (player.HeroClassDefinition.MaleActorSno != 0)
                    {
                        HeroTexture = Hud.Texture.GetTexture(44435619);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(876580014);
                    }
                }


                var BattleTagTexture = Hud.Texture.GetTexture(3098562643);
                var TownTexture      = Hud.Texture.GetTexture(3153923970);
                var ToScreenPos      = coordinates[currentAct][playerIndex].ToScreenCoordinate();

                BattleTagTexture.Draw((float)(ToScreenPos.X - (ScreenWidth / 32.653)), (float)(ToScreenPos.Y - (ScreenHeight / 52.941)), (float)(ScreenWidth / 10), (float)(ScreenHeight / 28), 0.7843f);
                HeroTexture.Draw((float)(ToScreenPos.X - (ScreenWidth / 28.769)), (float)(ToScreenPos.Y - (ScreenHeight / 52.941)), (float)(ScreenWidth / 56), (float)(ScreenHeight / 31), 0.7843f);
                TagDecorator.Paint((float)(ToScreenPos.X - (ScreenWidth / 41)), (float)(ToScreenPos.Y - (ScreenHeight / 100)), (float)(ScreenWidth / 11.5), (float)(ScreenHeight / 45), HorizontalAlign.Center);
                if (player.IsInTown && SeePlayersInTown)
                {
                    TownTexture.Draw((float)(ToScreenPos.X + (ScreenWidth / 20)), (float)(ToScreenPos.Y - (ScreenHeight / 52.941)), (float)(ScreenHeight / 27), (float)(ScreenHeight / 26), 0.7843f);
                }
            }
        }
Exemplo n.º 31
0
        public void PaintWorld(WorldLayer layer)
        {
            px = Hud.Window.Size.Width * 0.00155f * XScaling;
            py = Hud.Window.Size.Height * 0.001667f * YScaling;
            h  = py * 6;
            w2 = px * 60;
            float yref = 0.01f;
            int   summonerelite1count   = 0;
            int   summonerelite2count   = 0;
            int   summonedelite1count   = 0;
            int   summonedelite2count   = 0;
            int   summonedcount         = 0;
            int   summoner1count        = 0;
            int   summoner2count        = 0;
            int   monstersCountBaseYard = 0;
            int   monstersCountMaxYard  = 0;

            if (ShowMeScreenBaseYard)
            {
                var monsters1 = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= BaseYard);
                foreach (var monster in monsters1)
                {
                    monstersCountBaseYard++;
                }
                var text1  = string.Format("{0} Yard : {1}", BaseYard, monstersCountBaseYard);
                var layer1 = DefaultTextFont.GetTextLayout(text1);
                DefaultTextFont.DrawText(layer1, Hud.Window.Size.Width * 0.34f, Hud.Window.Size.Height * 0.22f);
            }
            if (ShowMeScreenMaxYard)
            {
                var monsters2 = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= MaxYard);
                foreach (var monster in monsters2)
                {
                    monstersCountMaxYard++;
                }
                var text2  = string.Format("{0} Yard : {1}", MaxYard, monstersCountMaxYard);
                var layer2 = DefaultTextFont.GetTextLayout(text2);
                DefaultTextFont.DrawText(layer2, Hud.Window.Size.Width * 0.34f, Hud.Window.Size.Height * 0.24f);
            }

            if (showdifLabel)
            {
                var monsters3 = Hud.Game.AliveMonsters.Where(m => (m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite);
                foreach (var monster in monsters3)
                {
                    var summonerMonsters = SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameLocalized) || SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameLocalized);
                    if (summonerMonsters)
                    {
                        if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) < BaseYard)
                        {
                            Decoratorred.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                        else
                        {
                            Decoratorgray.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                    }
                }
            }

            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                if (monster.IsElite)
                {
                    if (SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameLocalized))
                    {
                        if (monster.SummonerAcdDynamicId == 0)
                        {
                            summonerelite1count++;
                        }
                        else
                        {
                            summonedelite1count++;
                        }
                        if (ShowSummonerEliteBar)
                        {
                            DrawHealthBar(layer, monster, ref yref);
                            yref += 0.5f;
                        }
                        if (!showdifLabel)
                        {
                            Decorator.Paint(layer, monster, monster.FloorCoordinate, "E" + monster.SnoMonster.NameLocalized);
                        }
                    }
                    if (SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameLocalized))
                    {
                        if (monster.SummonerAcdDynamicId == 0)
                        {
                            summonerelite2count++;
                        }
                        else
                        {
                            summonedelite2count++;
                        }
                        if (ShowSummonerEliteBar)
                        {
                            DrawHealthBar(layer, monster, ref yref);
                            yref += 0.5f;
                        }
                        if (!showdifLabel)
                        {
                            Decorator.Paint(layer, monster, monster.FloorCoordinate, "E" + monster.SnoMonster.NameLocalized);
                        }
                    }
                }
            }
            foreach (var monster in monsters)
            {
                if (!monster.IsElite)
                {
                    if (monster.SummonerAcdDynamicId != 0)
                    {
                        summonedcount++;
                    }
                    if (SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames1.ContainsKey(monster.SnoMonster.NameLocalized))
                    {
                        summoner1count++;
                        if (ShowSummonerNormalMonsterBar)
                        {
                            DrawHealthBar(layer, monster, ref yref);
                            yref += 0.5f;
                        }
                        if (!showdifLabel)
                        {
                            Decorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                    }
                    if (SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameEnglish) || SummonerMonsternames2.ContainsKey(monster.SnoMonster.NameLocalized))
                    {
                        summoner2count++;
                        if (ShowSummonerNormalMonsterBar)
                        {
                            DrawHealthBar(layer, monster, ref yref);
                            yref += 0.5f;
                        }
                        if (!showdifLabel)
                        {
                            Decorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                    }
                }
            }


            if (ShowSummonerCount)
            {
                textBuilder.Clear();
                if (summonerelite1count > 0)
                {
                    textBuilder.AppendFormat("EZombieS: {0}", summonerelite1count);
                    textBuilder.AppendLine();
                }
                if (summonedelite1count > 0)
                {
                    textBuilder.AppendFormat("illuZombieS: {0}", summonedelite1count);
                    textBuilder.AppendLine();
                }
                if (summonerelite2count > 0)
                {
                    textBuilder.AppendFormat("ESkeletonS: {0}", summonerelite2count);
                    textBuilder.AppendLine();
                }
                if (summonedelite2count > 0)
                {
                    textBuilder.AppendFormat("illuSkeletonS: {0}", summonedelite2count);
                    textBuilder.AppendLine();
                }
                if (summoner1count > 0)
                {
                    textBuilder.AppendFormat("ZombieS: {0}", summoner1count);
                    textBuilder.AppendLine();
                }
                if (summoner2count > 0)
                {
                    textBuilder.AppendFormat("SkeletonS: {0}", summoner2count);
                    textBuilder.AppendLine();
                }
                if (summonedcount > 0)
                {
                    textBuilder.AppendLine();
                    textBuilder.AppendFormat("Summoned: {0}", summonedcount);
                    textBuilder.AppendLine();
                }
                var layout = DefaultTextFont.GetTextLayout(textBuilder.ToString());
                DefaultTextFont.DrawText(layout, Hud.Window.Size.Width * 0.76f, Hud.Window.Size.Height * 0.61f);
            }
        }
Exemplo n.º 32
0
 public void PaintWorld(WorldLayer layer)
 {
 }
Exemplo n.º 33
0
        public void PaintWorld(WorldLayer layer)
        {
            var actors = Hud.Game.Actors;
            var me     = Hud.Game.Me;

            sbremaining = 1.25f - ((Hud.Game.CurrentGameTick - sbstarpactstarttict) / 60.0f);
            if (sbstarpacttimerRunning == true && sbremaining <= 0)
            {
                sbstarpacttimerRunning = false;
            }
            if (sbremaining < 0)
            {
                sbremaining = 0;
            }
            float x    = Hud.Window.Size.Width / 2 - Hud.Window.Size.Width * 0.038f;
            float y    = Hud.Window.Size.Height / 2 - Hud.Window.Size.Height * 0.4f;
            var   rect = new RectangleF(x, y, 40.0f, 40.0f);

            if (coe == "ºñ")
            {
                visionBrush.DrawRectangle(rect);
                edgeBrush.DrawRectangle(rect);
            }
            dynamoBrush.DrawRectangle(rect.X + 120.0f, rect.Y, 40.0f, 40.0f);

            var resourcetext = textFont.GetTextLayout(Math.Truncate(resourcesb).ToString());

            textFont.DrawText(resourcetext, Hud.Window.Size.Width * 0.435f, Hud.Window.Size.Height * 0.1f);
            Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P2_Unique_Ring_04).Draw(rect);
            if (String.IsNullOrEmpty(coe))
            {
                coe = "";
            }
            var coetext = StackFont.GetTextLayout(coe);

            StackFont.DrawText(coetext, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(coetext.Metrics.Width), rect.Bottom - coetext.Metrics.Height);
            Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(243141).NormalIconTextureId).Draw(rect.X + 40.0f, rect.Y, 40.0f, 40.0f);
            var layout = StackFont.GetTextLayout(blackHolesb.ToString());

            StackFont.DrawText(layout, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout.Metrics.Width) + 40.0f, rect.Bottom - layout.Metrics.Height);
            Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(30796).NormalIconTextureId).Draw(rect.X + 80.0f, rect.Y, 40.0f, 40.0f);
            var layout1 = StackFont.GetTextLayout(waveOfForcesb.ToString());

            StackFont.DrawText(layout1, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout1.Metrics.Width) + 80.0f, rect.Bottom - layout1.Metrics.Height);
            Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(208823).NormalIconTextureId).Draw(rect.X + 120.0f, rect.Y, 40.0f, 40.0f);
            var layout2 = StackFont.GetTextLayout(arcaneDynamosb.ToString());

            StackFont.DrawText(layout2, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout2.Metrics.Width) + 120.0f, rect.Bottom - layout2.Metrics.Height);

            if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && Hud.Game.Me.Stats.ResourceCurArcane > 0)
            {
                var skill = Hud.Game.Me.Powers.GetBuff(243141);
                if (skill != null && Hud.Game.Me.Powers.GetBuff(243141).IconCounts[5] > 0)
                {
                    getv      = true;
                    blackHole = Hud.Game.Me.Powers.GetBuff(243141).IconCounts[5];
                    resource  = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else if (getv == true)
                {
                    resource = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else
                {
                    blackHole = 0;
                }
                var skill1 = Hud.Game.Me.Powers.GetBuff(30796);
                if (skill1 != null && Hud.Game.Me.Powers.GetBuff(30796).IconCounts[2] > 0)
                {
                    getv1       = true;
                    waveOfForce = Hud.Game.Me.Powers.GetBuff(30796).IconCounts[2];
                    resource    = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else if (getv1 == true)
                {
                    resource = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else
                {
                    waveOfForce = 0;
                }
                var skill2 = Hud.Game.Me.Powers.GetBuff(208823);
                if (skill2 != null && Hud.Game.Me.Powers.GetBuff(208823).IconCounts[1] > 0)
                {
                    getv2        = true;
                    arcaneDynamo = Hud.Game.Me.Powers.GetBuff(208823).IconCounts[1];
                    resource     = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else if (getv2 == true)
                {
                    resource = Hud.Game.Me.Stats.ResourceCurArcane;
                }
                else
                {
                    arcaneDynamo = 0;
                }
            }

            foreach (var actor in actors)
            {
                switch (actor.SnoActor.Sno)
                {
                case 217142:
                    if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                    {
                        if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && me.Stats.ResourceCurArcane < 5)
                        {
                            if (!sbstarpacttimerRunning)
                            {
                                sbstarpactstarttict    = Hud.Game.CurrentGameTick;
                                sbstarpacttimerRunning = true;
                                if (blackHole > 0)
                                {
                                    blackHolesb = blackHole;
                                }
                                else
                                {
                                    blackHolesb = 0;
                                }
                                if (waveOfForce > 0)
                                {
                                    waveOfForcesb = waveOfForce;
                                }
                                else
                                {
                                    waveOfForcesb = 0;
                                }
                                if (arcaneDynamo > 0)
                                {
                                    arcaneDynamosb = arcaneDynamo;
                                }
                                else
                                {
                                    arcaneDynamosb = 0;
                                }
                                resourcesb = resource;

                                blackHole    = 0;
                                waveOfForce  = 0;
                                arcaneDynamo = 0;
                                resource     = 0;
                            }
                            break;
                        }
                        if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && sbremaining > 0)
                        {
                            if (sbstarpacttimerRunning)
                            {
                                sbstarpacttimerRunning = false;
                                getv  = false;
                                getv1 = false;
                                getv2 = false;
                            }
                            if (sbremaining < 0.1 && sbremaining > 0)
                            {
                                if (me.Powers.BuffIsActive(430674, 1))
                                {
                                    coe = "ºñ";
                                }
                                else if (me.Powers.BuffIsActive(430674, 2))
                                {
                                    coe = "³Ã";
                                }
                                else if (me.Powers.BuffIsActive(430674, 3))
                                {
                                    coe = "È­";
                                }
                                else if (me.Powers.BuffIsActive(430674, 5))
                                {
                                    coe = "¹ø";
                                }
                                else
                                {
                                    coe = "";
                                }
                                break;
                            }
                            break;
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 34
0
		public bool IsDrawingLayer(WorldLayer layer)
		{
			return (_layerMask & layer.Id) != 0;
		}
Exemplo n.º 35
0
 public void AddLayer(WorldLayer lay)
 {
     if( lay != null && m_Layers != null )
     m_Layers.Add(lay.LayerName, lay);
 }
Exemplo n.º 36
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!Hud.Game.IsInTown)
            {
                return;
            }

            var me = Hud.Game.Me;

            if (ScanPlayer)
            {
                ScanPlayer = false;

                string NemPlayer = string.Empty;

                NemesisCount = 0;
                foreach (var player in Hud.Game.Players.OrderBy(p => p.PortraitIndex))
                {
                    if (player == null)
                    {
                        continue;
                    }

                    var Nemesis = player.Powers.GetBuff(318820);                                // Nemesis Bracers

                    if (Nemesis != null && Nemesis.Active)
                    {
                        NemesisCount++;
                        if (NemesisCount > 1)                                   // more than one player
                        {
                            NemPlayer += ", ";
                        }
                        NemPlayer += player.BattleTagAbovePortrait;
                    }
                }

                NemStr = NemesisCount.ToString();
                if (NemesisCount > 0)
                {
                    NemStr += " -> " + NemPlayer;
                }

                w = NemStr.Length * 12;                 // 12 pixel per letter (FYI, I'm using Hangul, which is Korean language)
                if (w < 150)
                {
                    w = 150;
                }
                h = 55;
                x = Hud.Window.Size.Width / 2 - 480;
                y = 20;
            }

            var tmp = (culture == "ko") ? "천벌 손목" : "Nemesis Bracers";

            NemesisPlayerDecorator.Paint(x, y, w, h, NemStr, tmp);
            if (Hud.Render.GetUiElement("Root.NormalLayer.rift_dialog_mainPage").Visible || IsGRiftDialog)
            {
                if (NemesisCount == 0)
                {
                    WarningMsg = (culture == "ko") ? "천벌 착용자 없음!" : "No one with Nemesis Bracers!";
                    WarningMessageDecorator.Paint(layer, null, me.FloorCoordinate.Offset(0, 0, 15), WarningMsg);
                    if (Hud.Sound.LastSpeak.TimerTest(5000))
                    {
                        Hud.Sound.Speak(WarningMsg);
                        Console.Beep(900, 200);
                    }
                }
                else if (NemesisCount > 1)
                {
                    WarningMsg  = (culture == "ko") ? "천벌 착용자 2명 이상 -> " : "More than one with Nemesis -> ";
                    WarningMsg += NemesisCount.ToString("0");
                    NoticeMessageDecorator.Paint(layer, null, me.FloorCoordinate.Offset(0, 0, 15), WarningMsg);
                }
            }

            var obeliskPos = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_openworld_lootrunobelisk_b && x.IsOnScreen);

            obeliskText = "" + keys;
            foreach (var actor in obeliskPos)
            {
                if (keys <= keysBad)
                {
                    keysDecoratorBad.Paint(layer, actor, actor.FloorCoordinate, obeliskText);
                }
                else if (keys > keysBad && keys < keysOK)
                {
                    keysDecoratorWarning.Paint(layer, actor, actor.FloorCoordinate, obeliskText);
                }
                else                    //if (keys >= keysOK)
                {
                    keysDecoratorOk.Paint(layer, actor, actor.FloorCoordinate, obeliskText);
                }
            }
        }
Exemplo n.º 37
0
 protected City(WorldLayer _layer, params Point[] _cityBlockIds)
 {
     Layer = _layer;
     CityBlockIds = _cityBlockIds.ToArray();
 }
Exemplo n.º 38
0
        public void PaintWorld(WorldLayer layer)
        {
            var players = Hud.Game.Players.Where(player => !player.IsMe && player.CoordinateKnown && (player.HeadStone == null));

            foreach (var player in players)
            {
                var HeroTexture = Hud.Texture.GetTexture(890155253);

                if (player.HeroClassDefinition.HeroClass.ToString() == "Barbarian")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3921484788);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1030273087);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Crusader")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3742271755);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(3435775766);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "DemonHunter")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3785199803);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2939779782);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Monk")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(2227317895);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(2918463890);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Necromancer")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3285997023);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(473831658);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "WitchDoctor")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(3925954876);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(1603231623);
                    }
                }
                else if (player.HeroClassDefinition.HeroClass.ToString() == "Wizard")
                {
                    if (player.HeroIsMale)
                    {
                        HeroTexture = Hud.Texture.GetTexture(44435619);
                    }
                    else
                    {
                        HeroTexture = Hud.Texture.GetTexture(876580014);
                    }
                }
                float PlayersHeadOpacity = 1f;
                var   Elites             = Hud.Game.Monsters.Where(M => M.IsAlive && M.Rarity != ActorRarity.Normal && M.Rarity != ActorRarity.RareMinion && M.Rarity != ActorRarity.Hireling && M.FloorCoordinate.XYDistanceTo(player.FloorCoordinate) <= 25);
                if (Elites.Count() > 0)
                {
                    PlayersHeadOpacity = 0.20f;
                }

                float textureX, textureY;
                Hud.Render.GetMinimapCoordinates(player.FloorCoordinate.X, player.FloorCoordinate.Y, out textureX, out textureY);
                HeroTexture.Draw(textureX - 11, textureY - 11, 22.3f, 24.1f, PlayersHeadOpacity);

                WorldDecoratorCollection decorator;
                if (!DecoratorByClass.TryGetValue(player.HeroClassDefinition.HeroClass, out decorator))
                {
                    continue;
                }

                decorator.Paint(layer, null, player.FloorCoordinate.Offset(NameOffsetX, NameOffsetY, NameOffsetZ), player.BattleTagAbovePortrait);
                if (IsZDPS(player))
                {
                    ZDPSDecorator.Paint(layer, null, player.FloorCoordinate, "Z");
                }
            }

            if (ShowCompanions && Hud.Game.NumberOfPlayersInGame == 1)
            {
                var companions = Hud.Game.Actors.Where(C => C.SnoActor.Sno == 52694 || C.SnoActor.Sno == 4482 || C.SnoActor.Sno == 52693);
                foreach (var companion in companions)
                {
                    var CompTexture = Hud.Texture.GetTexture(890155253);
                    if (companion.SnoActor.Sno == 52694)
                    {
                        CompTexture = Hud.Texture.GetTexture(441912908);                                // scoundrel
                    }
                    else if (companion.SnoActor.Sno == 4482)
                    {
                        CompTexture = Hud.Texture.GetTexture(2807221403);                                    // enchantress
                    }
                    else if (companion.SnoActor.Sno == 52693)
                    {
                        CompTexture = Hud.Texture.GetTexture(1094113362);                                     // templar
                    }
                    else
                    {
                        continue;
                    }

                    float CompanionsHeadOpacity = 1f;
                    var   Elites = Hud.Game.Monsters.Where(M => M.IsAlive && M.Rarity != ActorRarity.Normal && M.Rarity != ActorRarity.RareMinion && M.Rarity != ActorRarity.Hireling && M.FloorCoordinate.XYDistanceTo(companion.FloorCoordinate) <= 25);
                    if (Elites.Count() > 0)
                    {
                        CompanionsHeadOpacity = 0.20f;
                    }

                    float textureX, textureY;
                    Hud.Render.GetMinimapCoordinates(companion.FloorCoordinate.X, companion.FloorCoordinate.Y, out textureX, out textureY);
                    CompTexture.Draw(textureX - 11, textureY - 11, 22.3f, 24.1f, CompanionsHeadOpacity);
                }
            }
        }
 public void PaintWorld(WorldLayer layer)
 {
     AlertList.PaintWorld(layer);
 }
 // All sprites in the scene should be added through this method to ensure they are placed in the correct world layer.
 public void AddNode(SKNode node, WorldLayer layer)
 {
     SKNode layerNode = layers [(int)layer];
     layerNode.AddChild (node);
 }