QuickDust() public static method

public static QuickDust ( Point tileCoords, Color color ) : Dust
tileCoords Point
color Color
return Dust
Example #1
0
 public static void SendWalker(
     Point startFloorPosition,
     int height,
     int direction,
     out int distanceCoveredInTiles,
     out Point lastIteratedFloorSpot,
     int maxDistance = 100,
     bool showDebug  = false)
 {
     distanceCoveredInTiles = 0;
     --startFloorPosition.Y;
     lastIteratedFloorSpot = startFloorPosition;
     for (int index1 = 0; index1 < maxDistance; ++index1)
     {
         for (int index2 = 0; index2 < 3 && WorldGen.SolidTile3(startFloorPosition.X, startFloorPosition.Y); ++index2)
         {
             --startFloorPosition.Y;
         }
         int topY1;
         int bottomY1;
         Collision.ExpandVertically(startFloorPosition.X, startFloorPosition.Y, out topY1, out bottomY1, height, 2);
         ++topY1;
         --bottomY1;
         if (!WorldGen.SolidTile3(startFloorPosition.X, bottomY1 + 1))
         {
             int topY2;
             int bottomY2;
             Collision.ExpandVertically(startFloorPosition.X, bottomY1, out topY2, out bottomY2, 0, 6);
             if (showDebug)
             {
                 Dust.QuickBox(new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(topY2 * 16)), new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(bottomY2 * 16)), 1, Color.Blue, (Action <Dust>)null);
             }
             if (!WorldGen.SolidTile3(startFloorPosition.X, bottomY2))
             {
                 break;
             }
         }
         if (bottomY1 - topY1 >= height - 1)
         {
             if (showDebug)
             {
                 Dust.QuickDust(startFloorPosition, Color.Green).scale = 1f;
                 Dust.QuickBox(new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(topY1 * 16)), new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(bottomY1 * 16 + 16)), 1, Color.Red, (Action <Dust>)null);
             }
             distanceCoveredInTiles += direction;
             startFloorPosition.X   += direction;
             startFloorPosition.Y    = bottomY1;
             lastIteratedFloorSpot   = startFloorPosition;
             if (Math.Abs(distanceCoveredInTiles) >= maxDistance)
             {
                 break;
             }
         }
         else
         {
             break;
         }
     }
     distanceCoveredInTiles = Math.Abs(distanceCoveredInTiles);
 }
Example #2
0
        // Token: 0x0600004D RID: 77 RVA: 0x0000824C File Offset: 0x0000644C
        public static void CheckArenaScore(Vector2 arenaCenter, out Point xLeftEnd, out Point xRightEnd, int walkerWidthInTiles = 5, int walkerHeightInTiles = 10)
        {
            bool  flag  = false;
            Point point = arenaCenter.ToTileCoordinates();

            xLeftEnd = (xRightEnd = point);
            int num;
            int y;

            Collision.ExpandVertically(point.X, point.Y, out num, out y, 0, 4);
            point.Y = y;
            if (flag)
            {
                Dust.QuickDust(point, Color.Blue).scale = 5f;
            }
            int   num2;
            Point point2;

            StrayMethods.SendWalker(point, walkerHeightInTiles, -1, out num2, out point2, 120, flag);
            int   num3;
            Point point3;

            StrayMethods.SendWalker(point, walkerHeightInTiles, 1, out num3, out point3, 120, flag);
            point2.X++;
            point3.X--;
            if (flag)
            {
                Dust.QuickDustLine(point2.ToWorldCoordinates(8f, 8f), point3.ToWorldCoordinates(8f, 8f), 50f, Color.Pink);
            }
            xLeftEnd  = point2;
            xRightEnd = point3;
        }
Example #3
0
        public static void CheckArenaScore(
            Vector2 arenaCenter,
            out Point xLeftEnd,
            out Point xRightEnd,
            int walkerWidthInTiles  = 5,
            int walkerHeightInTiles = 10)
        {
            bool  showDebug       = false;
            Point tileCoordinates = arenaCenter.ToTileCoordinates();

            xLeftEnd = xRightEnd = tileCoordinates;
            int bottomY;

            Collision.ExpandVertically(tileCoordinates.X, tileCoordinates.Y, out int _, out bottomY, 0, 4);
            tileCoordinates.Y = bottomY;
            if (showDebug)
            {
                Dust.QuickDust(tileCoordinates, Color.Blue).scale = 5f;
            }
            Point lastIteratedFloorSpot1;

            StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, -1, out int _, out lastIteratedFloorSpot1, 120, showDebug);
            Point lastIteratedFloorSpot2;

            StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, 1, out int _, out lastIteratedFloorSpot2, 120, showDebug);
            ++lastIteratedFloorSpot1.X;
            --lastIteratedFloorSpot2.X;
            if (showDebug)
            {
                Dust.QuickDustLine(lastIteratedFloorSpot1.ToWorldCoordinates(8f, 8f), lastIteratedFloorSpot2.ToWorldCoordinates(8f, 8f), 50f, Color.Pink);
            }
            xLeftEnd  = lastIteratedFloorSpot1;
            xRightEnd = lastIteratedFloorSpot2;
        }
Example #4
0
        public static void CheckArenaScore(Vector2 arenaCenter, out Point xLeftEnd, out Point xRightEnd, int walkerWidthInTiles = 5, int walkerHeightInTiles = 10)
        {
            bool  showDebug       = false;
            Point tileCoordinates = arenaCenter.ToTileCoordinates();

            xLeftEnd = xRightEnd = tileCoordinates;
            int topY;
            int bottomY;

            Collision.ExpandVertically((int)tileCoordinates.X, (int)tileCoordinates.Y, out topY, out bottomY, 0, 4);
            tileCoordinates.Y = (__Null)bottomY;
            if (showDebug)
            {
                Dust.QuickDust(tileCoordinates, Color.get_Blue()).scale = 5f;
            }
            int   distanceCoveredInTiles1;
            Point lastIteratedFloorSpot1;

            StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, -1, out distanceCoveredInTiles1, out lastIteratedFloorSpot1, 120, showDebug);
            int   distanceCoveredInTiles2;
            Point lastIteratedFloorSpot2;

            StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, 1, out distanceCoveredInTiles2, out lastIteratedFloorSpot2, 120, showDebug);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            __Null& local1 = @lastIteratedFloorSpot1.X;
            // ISSUE: cast to a reference type
            // ISSUE: explicit reference operation
            int num1 = ^ (int&)local1 + 1;
Example #5
0
 // Token: 0x0600004E RID: 78 RVA: 0x00008328 File Offset: 0x00006528
 public static void SendWalker(Point startFloorPosition, int height, int direction, out int distanceCoveredInTiles, out Point lastIteratedFloorSpot, int maxDistance = 100, bool showDebug = false)
 {
     distanceCoveredInTiles = 0;
     startFloorPosition.Y--;
     lastIteratedFloorSpot = startFloorPosition;
     for (int i = 0; i < maxDistance; i++)
     {
         int num = 0;
         while (num < 3 && WorldGen.SolidTile3(startFloorPosition.X, startFloorPosition.Y))
         {
             startFloorPosition.Y--;
             num++;
         }
         int num2;
         int num3;
         Collision.ExpandVertically(startFloorPosition.X, startFloorPosition.Y, out num2, out num3, height, 2);
         num2++;
         num3--;
         if (!WorldGen.SolidTile3(startFloorPosition.X, num3 + 1))
         {
             int num4;
             int num5;
             Collision.ExpandVertically(startFloorPosition.X, num3, out num4, out num5, 0, 6);
             if (showDebug)
             {
                 Dust.QuickBox(new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(num4 * 16)), new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(num5 * 16)), 1, Color.Blue, null);
             }
             if (!WorldGen.SolidTile3(startFloorPosition.X, num5))
             {
                 break;
             }
         }
         if (num3 - num2 < height - 1)
         {
             break;
         }
         if (showDebug)
         {
             Dust.QuickDust(startFloorPosition, Color.Green).scale = 1f;
             Dust.QuickBox(new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(num2 * 16)), new Vector2((float)(startFloorPosition.X * 16 + 8), (float)(num3 * 16 + 16)), 1, Color.Red, null);
         }
         distanceCoveredInTiles += direction;
         startFloorPosition.X   += direction;
         startFloorPosition.Y    = num3;
         lastIteratedFloorSpot   = startFloorPosition;
         if (Math.Abs(distanceCoveredInTiles) >= maxDistance)
         {
             break;
         }
     }
     distanceCoveredInTiles = Math.Abs(distanceCoveredInTiles);
 }
 public static void SendWalker(Point startFloorPosition, int height, int direction, out int distanceCoveredInTiles, out Point lastIteratedFloorSpot, int maxDistance = 100, bool showDebug = false)
 {
     distanceCoveredInTiles = 0;
     startFloorPosition.Y--;
     lastIteratedFloorSpot = startFloorPosition;
     for (int i = 0; i < maxDistance; i++)
     {
         for (int j = 0; j < 3; j++)
         {
             if (!WorldGen.SolidTile3(startFloorPosition.X, startFloorPosition.Y))
             {
                 break;
             }
             startFloorPosition.Y--;
         }
         Collision.ExpandVertically(startFloorPosition.X, startFloorPosition.Y, out var topY, out var bottomY, height, 2);
         topY++;
         bottomY--;
         if (!WorldGen.SolidTile3(startFloorPosition.X, bottomY + 1))
         {
             Collision.ExpandVertically(startFloorPosition.X, bottomY, out var topY2, out var bottomY2, 0, 6);
             if (showDebug)
             {
                 Dust.QuickBox(new Vector2(startFloorPosition.X * 16 + 8, topY2 * 16), new Vector2(startFloorPosition.X * 16 + 8, bottomY2 * 16), 1, Color.Blue, null);
             }
             if (!WorldGen.SolidTile3(startFloorPosition.X, bottomY2))
             {
                 break;
             }
         }
         if (bottomY - topY < height - 1)
         {
             break;
         }
         if (showDebug)
         {
             Dust.QuickDust(startFloorPosition, Color.Green).scale = 1f;
             Dust.QuickBox(new Vector2(startFloorPosition.X * 16 + 8, topY * 16), new Vector2(startFloorPosition.X * 16 + 8, bottomY * 16 + 16), 1, Color.Red, null);
         }
         distanceCoveredInTiles += direction;
         startFloorPosition.X   += direction;
         startFloorPosition.Y    = bottomY;
         lastIteratedFloorSpot   = startFloorPosition;
         if (Math.Abs(distanceCoveredInTiles) >= maxDistance)
         {
             break;
         }
     }
     distanceCoveredInTiles = Math.Abs(distanceCoveredInTiles);
 }
        public static void CheckArenaScore(Vector2 arenaCenter, out Point xLeftEnd, out Point xRightEnd, int walkerWidthInTiles = 5, int walkerHeightInTiles = 10)
        {
            bool  flag  = false;
            Point point = arenaCenter.ToTileCoordinates();

            xLeftEnd = (xRightEnd = point);
            Collision.ExpandVertically(point.X, point.Y, out var _, out var bottomY, 0, 4);
            point.Y = bottomY;
            if (flag)
            {
                Dust.QuickDust(point, Color.Blue).scale = 5f;
            }
            SendWalker(point, walkerHeightInTiles, -1, out var _, out var lastIteratedFloorSpot, 120, flag);
            SendWalker(point, walkerHeightInTiles, 1, out var _, out var lastIteratedFloorSpot2, 120, flag);
            lastIteratedFloorSpot.X++;
            lastIteratedFloorSpot2.X--;
            if (flag)
            {
                Dust.QuickDustLine(lastIteratedFloorSpot.ToWorldCoordinates(), lastIteratedFloorSpot2.ToWorldCoordinates(), 50f, Color.Pink);
            }
            xLeftEnd  = lastIteratedFloorSpot;
            xRightEnd = lastIteratedFloorSpot2;
        }
Example #8
0
 public static void CheckArenaScore(Vector2 arenaCenter, out Point xLeftEnd, out Point xRightEnd, int walkerWidthInTiles = 5, int walkerHeightInTiles = 10)
 {
   bool showDebug = false;
   Point tileCoordinates = arenaCenter.ToTileCoordinates();
   xLeftEnd = xRightEnd = tileCoordinates;
   int topY;
   int bottomY;
   Collision.ExpandVertically((int) tileCoordinates.X, (int) tileCoordinates.Y, out topY, out bottomY, 0, 4);
   tileCoordinates.Y = (__Null) bottomY;
   if (showDebug)
     Dust.QuickDust(tileCoordinates, Color.get_Blue()).scale = 5f;
   int distanceCoveredInTiles1;
   Point lastIteratedFloorSpot1;
   StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, -1, out distanceCoveredInTiles1, out lastIteratedFloorSpot1, 120, showDebug);
   int distanceCoveredInTiles2;
   Point lastIteratedFloorSpot2;
   StrayMethods.SendWalker(tileCoordinates, walkerHeightInTiles, 1, out distanceCoveredInTiles2, out lastIteratedFloorSpot2, 120, showDebug);
   // ISSUE: explicit reference operation
   // ISSUE: variable of a reference type
   Point& local1 = @lastIteratedFloorSpot1;
   // ISSUE: explicit reference operation
   int num1 = (^local1).X + 1;
   // ISSUE: explicit reference operation
   (^local1).X = (__Null) num1;
   // ISSUE: explicit reference operation
   // ISSUE: variable of a reference type
   Point& local2 = @lastIteratedFloorSpot2;
   // ISSUE: explicit reference operation
   int num2 = (^local2).X - 1;
   // ISSUE: explicit reference operation
   (^local2).X = (__Null) num2;
   if (showDebug)
     Dust.QuickDustLine(lastIteratedFloorSpot1.ToWorldCoordinates(8f, 8f), lastIteratedFloorSpot2.ToWorldCoordinates(8f, 8f), 50f, Color.get_Pink());
   xLeftEnd = lastIteratedFloorSpot1;
   xRightEnd = lastIteratedFloorSpot2;
 }
Example #9
0
 public static void SendWalker(Point startFloorPosition, int height, int direction, out int distanceCoveredInTiles, out Point lastIteratedFloorSpot, int maxDistance = 100, bool showDebug = false)
 {
   distanceCoveredInTiles = 0;
   // ISSUE: explicit reference operation
   // ISSUE: variable of a reference type
   Point& local1 = @startFloorPosition;
   // ISSUE: explicit reference operation
   int num1 = (^local1).Y - 1;
   // ISSUE: explicit reference operation
   (^local1).Y = (__Null) num1;
   lastIteratedFloorSpot = startFloorPosition;
   for (int index1 = 0; index1 < maxDistance; ++index1)
   {
     for (int index2 = 0; index2 < 3 && WorldGen.SolidTile3((int) startFloorPosition.X, (int) startFloorPosition.Y); ++index2)
     {
       // ISSUE: explicit reference operation
       // ISSUE: variable of a reference type
       Point& local2 = @startFloorPosition;
       // ISSUE: explicit reference operation
       int num2 = (^local2).Y - 1;
       // ISSUE: explicit reference operation
       (^local2).Y = (__Null) num2;
     }
     int topY1;
     int bottomY1;
     Collision.ExpandVertically((int) startFloorPosition.X, (int) startFloorPosition.Y, out topY1, out bottomY1, height, 2);
     ++topY1;
     --bottomY1;
     if (!WorldGen.SolidTile3((int) startFloorPosition.X, bottomY1 + 1))
     {
       int topY2;
       int bottomY2;
       Collision.ExpandVertically((int) startFloorPosition.X, bottomY1, out topY2, out bottomY2, 0, 6);
       if (showDebug)
         Dust.QuickBox(new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (topY2 * 16)), new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (bottomY2 * 16)), 1, Color.get_Blue(), (Action<Dust>) null);
       if (!WorldGen.SolidTile3((int) startFloorPosition.X, bottomY2))
         break;
     }
     if (bottomY1 - topY1 >= height - 1)
     {
       if (showDebug)
       {
         Dust.QuickDust(startFloorPosition, Color.get_Green()).scale = 1f;
         Dust.QuickBox(new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (topY1 * 16)), new Vector2((float) (startFloorPosition.X * 16 + 8), (float) (bottomY1 * 16 + 16)), 1, Color.get_Red(), (Action<Dust>) null);
       }
       distanceCoveredInTiles += direction;
       // ISSUE: explicit reference operation
       // ISSUE: variable of a reference type
       Point& local2 = @startFloorPosition;
       // ISSUE: explicit reference operation
       int num2 = (^local2).X + direction;
       // ISSUE: explicit reference operation
       (^local2).X = (__Null) num2;
       startFloorPosition.Y = (__Null) bottomY1;
       lastIteratedFloorSpot = startFloorPosition;
       if (Math.Abs(distanceCoveredInTiles) >= maxDistance)
         break;
     }
     else
       break;
   }
   distanceCoveredInTiles = Math.Abs(distanceCoveredInTiles);
 }