Exemplo n.º 1
0
        private void PaintFloorLines(IEnumerable <IMonster> monsters, IBrush brush)
        {
            var      lastCenter = Hud.Game.Me.FloorCoordinate;
            var      list       = new List <IMonster>(monsters);
            IMonster nearest    = null;

            foreach (var monster in list)
            {
                if (nearest == null || monster.CentralXyDistanceToMe < nearest.CentralXyDistanceToMe)
                {
                    nearest = monster;
                }
            }
            list.Remove(nearest);
            while (list.Count > 0)
            {
                IMonster nextNearest = null;
                foreach (var monster in list)
                {
                    if (nextNearest == null || monster.FloorCoordinate.XYDistanceTo(nearest.FloorCoordinate) < nextNearest.FloorCoordinate.XYDistanceTo(nearest.FloorCoordinate))
                    {
                        nextNearest = monster;
                    }
                }

                brush.DrawLineWorld(nearest.FloorCoordinate, nextNearest.FloorCoordinate);
                nearest = nextNearest;
                list.Remove(nextNearest);
            }
        }
Exemplo n.º 2
0
        private void Paint(float x, float y, float z, float radius, float rotation, IBrush brush)
        {
            var angleStep = 360f / VerticeCount;

            for (var i = 0; i < VerticeCount; i++)
            {
                var sx = radius * (float)Math.Cos((((i + 0) * angleStep) + rotation) * Math.PI / 180f);
                var sy = radius * (float)Math.Sin((((i + 0) * angleStep) + rotation) * Math.PI / 180f);
                var ex = radius * (float)Math.Cos((((i + VerticeJump) * angleStep) + rotation) * Math.PI / 180f);
                var ey = radius * (float)Math.Sin((((i + VerticeJump) * angleStep) + rotation) * Math.PI / 180f);
                brush.DrawLineWorld(x + sx, y + sy, z, x + ex, y + ey, z);
            }
        }
        private void DrawTargetLine(IWorldCoordinate awc, IWorldCoordinate twc, IMonster m, IMonster target)
        {
            IBrush cBrush = GreyBrush;

            if (m != null && target != null)
            {
                if (m.AnnId == target.AnnId)
                {
                    cBrush = GreenBrush;
                }
                else
                {
                    cBrush = RedBrush;
                    RedHitBoxDecorator.Paint(_layer, m, m.FloorCoordinate, string.Empty);
                }
            }
            cBrush.DrawLineWorld(awc, PointOnLine(awc, twc, HitYards), 4f);
        }