Esempio n. 1
0
 private void PlaceSlab(Slab slab, int originX, int originY, int scale)
 {
     for (int i = 0; i < scale; i++)
     {
         for (int j = 0; j < scale; j++)
         {
             Tile tile = GenBase._tiles[originX + i, originY + j];
             if (TileID.Sets.Ore[tile.type])
             {
                 tile.ResetToType(tile.type);
             }
             else
             {
                 tile.ResetToType(367);
             }
             bool active = slab.State(i, j, scale);
             tile.active(active);
             if (slab.HasWall)
             {
                 tile.wall = 178;
             }
             WorldUtils.TileFrame(originX + i, originY + j, true);
             WorldGen.SquareWallFrame(originX + i, originY + j);
             Tile.SmoothSlope(originX + i, originY + j);
             if (WorldGen.SolidTile(originX + i, originY + j - 1) && GenBase._random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + i, originY + j, 165);
             }
             if (WorldGen.SolidTile(originX + i, originY + j) && GenBase._random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + i, originY + j - 1, 165);
             }
         }
     }
 }
Esempio n. 2
0
        private void PlaceSlab(Slab slab, int originX, int originY, int scale)
        {
            for (int x = 0; x < scale; ++x)
            {
                for (int y = 0; y < scale; ++y)
                {
                    Tile tile = GenBase._tiles[originX + x, originY + y];
                    if (TileID.Sets.Ore[tile.type])
                        tile.ResetToType(tile.type);
                    else
                        tile.ResetToType(367);

                    bool active = slab.State(x, y, scale);
                    tile.active(active);
                    if (slab.HasWall)
                        tile.wall = 178;

                    WorldUtils.TileFrame(originX + x, originY + y, true);
                    WorldGen.SquareWallFrame(originX + x, originY + y, true);
                    Tile.SmoothSlope(originX + x, originY + y, true);
                    if (WorldGen.SolidTile(originX + x, originY + y - 1) && GenBase._random.Next(4) == 0)
                        WorldGen.PlaceTight(originX + x, originY + y, 165, false);
                    if (WorldGen.SolidTile(originX + x, originY + y) && GenBase._random.Next(4) == 0)
                        WorldGen.PlaceTight(originX + x, originY + y - 1, 165, false);
                }
            }
        }
Esempio n. 3
0
 private void PlaceSlab(Slab slab, int originX, int originY, int scale)
 {
     for (var x = 0; x < scale; ++x)
     {
         for (var y = 0; y < scale; ++y)
         {
             var tile = _tiles[originX + x, originY + y];
             if (TileID.Sets.Ore[tile.type])
             {
                 tile.ResetToType(tile.type);
             }
             else
             {
                 tile.ResetToType(367);
             }
             var active = slab.State(x, y, scale);
             tile.active(active);
             if (slab.HasWall)
             {
                 tile.wall = 178;
             }
             WorldUtils.TileFrame(originX + x, originY + y, true);
             WorldGen.SquareWallFrame(originX + x, originY + y, true);
             Tile.SmoothSlope(originX + x, originY + y, true);
             if (WorldGen.SolidTile(originX + x, originY + y - 1) && _random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + x, originY + y, 165, false);
             }
             if (WorldGen.SolidTile(originX + x, originY + y) && _random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + x, originY + y - 1, 165, false);
             }
         }
     }
 }
        private void PlaceSlab(Slab slab, int originX, int originY, int scale)
        {
            ushort num  = 367;
            ushort wall = 178;

            if (WorldGen.drunkWorldGen)
            {
                num  = 368;
                wall = 180;
            }
            int num2 = -1;
            int num3 = scale + 1;
            int num4 = 0;
            int num5 = scale;

            for (int i = num2; i < num3; i++)
            {
                if ((i == num2 || i == num3 - 1) && WorldGen.genRand.Next(2) == 0)
                {
                    continue;
                }
                if (WorldGen.genRand.Next(2) == 0)
                {
                    num4--;
                }
                if (WorldGen.genRand.Next(2) == 0)
                {
                    num5++;
                }
                for (int j = num4; j < num5; j++)
                {
                    Tile tile = GenBase._tiles[originX + i, originY + j];
                    tile.ResetToType(TileID.Sets.Ore[tile.type] ? tile.type : num);
                    bool active = slab.State(i, j, scale);
                    tile.active(active);
                    if (slab.HasWall)
                    {
                        tile.wall = wall;
                    }
                    WorldUtils.TileFrame(originX + i, originY + j, frameNeighbors: true);
                    WorldGen.SquareWallFrame(originX + i, originY + j);
                    Tile.SmoothSlope(originX + i, originY + j);
                    if (WorldGen.SolidTile(originX + i, originY + j - 1) && GenBase._random.Next(4) == 0)
                    {
                        WorldGen.PlaceTight(originX + i, originY + j);
                    }
                    if (WorldGen.SolidTile(originX + i, originY + j) && GenBase._random.Next(4) == 0)
                    {
                        WorldGen.PlaceTight(originX + i, originY + j - 1);
                    }
                }
            }
        }