示例#1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (!Hud.Game.IsInGame)
            {
                return;
            }
            if (OnlyGR && !Hud.Game.Me.InGreaterRift)
            {
                return;
            }

            var players = Hud.Game.Players.Where(p => p.HasValidActor && (p.IsMe || !OnlyMe) && p.Powers.UsedSkills.Any(s => s.SnoPower.Sno == 108506 && (s.Rune == 2 || p.Powers.BuffIsActive(484270))));

            if (players.Any())
            {
                var actors = Hud.Game.Actors.Where(a => (a.SnoActor.Sno == ActorSnoEnum._wd_spiritbarragerune_aoe_ghostmodel) && ((a.SummonerAcdDynamicId == Hud.Game.Me.SummonerId) || !OnlyMe));
                var x = Hud.Window.Size.Width * Xpor; var y = Hud.Window.Size.Height * Ypor;
                Hud.Texture.GetTexture(1117784160).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
                if (actors.Any())
                {
                    foreach (var a in actors)
                    {
                        if (!Phantasms.ContainsKey(a.AnnId))
                        {
                            Phantasms[a.AnnId] = a.CreatedAtInGameTick;
                        }
                    }
                    actors = actors.OrderByDescending(a => Phantasms[a.AnnId]);
                    Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
                    var c = 0;
                    foreach (var actor in actors)
                    {
                        if (c++ == 3)
                        {
                            break;
                        }
                        duration = (players.FirstOrDefault(p => (actor.SummonerAcdDynamicId == p.SummonerId) && p.Powers.BuffIsActive(484270)) != null) ? 10 : 5;
                        var t = duration - (Hud.Game.CurrentGameTick - Phantasms[actor.AnnId]) / 60f;
                        if (t <= 0)
                        {
                            var layout = FontExpl.GetTextLayout("🞴");
                            FontExpl.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width)) / 2.0f), y + (layout.Metrics.Height * 0.53f * (c - 1)));
                        }
                        else
                        {
                            FontDefault = (t > warning)? FontCounter:FontLimit;
                            var layout = FontDefault.GetTextLayout((t < 1)? String.Format("{0:N1}", t) : String.Format("{0:0}", (int)(t + 0.90)));                              // Redondeará a X si es menor  a X.10
                            FontDefault.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width)) / 2.0f), y + (layout.Metrics.Height * 0.73f * (c - 1)));
                        }
                    }
                }
                else
                {
                    Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
                }
            }
        }
        public void PaintWorld(WorldLayer layer)
        {
            if (!Hud.Game.IsInGame)
            {
                return;
            }
            if (layer != WorldLayer.Ground)
            {
                return;
            }

            var actors = Hud.Game.Actors.Where(a => a.SnoActor.Sno == ActorSnoEnum._wd_spiritbarragerune_aoe_ghostmodel);

            if (actors.Any())
            {
                foreach (var a in actors)
                {
                    if (!Phantasms.ContainsKey(a.AnnId))
                    {
                        Phantasms[a.AnnId] = a.CreatedAtInGameTick;
                    }
                }
                var total = 0;
                foreach (var player in Hud.Game.Players)
                {
                    if (!ShowOthers && !player.IsMe)
                    {
                        continue;
                    }
                    var actorsPlayer = actors.Where(a => a.SummonerAcdDynamicId == player.SummonerId).OrderByDescending(a => Phantasms[a.AnnId]);
                    var c            = 0;
                    foreach (var actor in actorsPlayer)
                    {
                        if (c++ == 3)
                        {
                            break;
                        }
                        total++;
                        var duration = player.Powers.BuffIsActive(484270)? 10d : 5d;
                        var elapsed  = (Hud.Game.CurrentGameTick - Phantasms[actor.AnnId]) / 60d;
                        if (elapsed < (duration + 0.1))
                        {
                            BrushSolid.DrawWorldEllipse(10, -1, actor.FloorCoordinate);
                            if (ShowExplosionCircle && (elapsed > CircleSeconds))
                            {
                                BrushDash.DrawWorldEllipse(15, -1, actor.FloorCoordinate);
                            }
                            if (actor.IsOnScreen)
                            {
                                var timeleft = duration - elapsed;      var x = actor.FloorCoordinate.ToScreenCoordinate().X; var y = actor.FloorCoordinate.ToScreenCoordinate().Y;
                                var radiusc = radius_countdown / 1200.0f * Hud.Window.Size.Height;

                                BrushCounter.DrawEllipse(x, y, radiusc, radiusc);
                                DrawTimeLeftClock(new RectangleF(x - radiusc / 2, y - radiusc / 2, radiusc, radiusc), elapsed, timeleft);

                                var layout = FontText.GetTextLayout((timeleft < 0)?"0.0":timeleft.ToString((timeleft > 1)?"F0":"F1"));
                                FontText.DrawText(layout, x - layout.Metrics.Width / 2, y - layout.Metrics.Height / 2 - 1);
                            }
                        }
                    }
                }
                if (ShowCounter)
                {
                    var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_progressBar_manaBall").Rectangle;
                    PhantomCountDecorator.Paint(uiRect.Left + uiRect.Width * 0.20f, uiRect.Top - uiRect.Height * 0.20f, uiRect.Width * 0.60f, uiRect.Height * 0.15f, "Phantom:" + total);
                }
            }
        }