Esempio n. 1
0
 // Token: 0x06000FAF RID: 4015 RVA: 0x003F7714 File Offset: 0x003F5914
 private void PlaceSlab(MarbleBiome.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[(int)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, true);
             Tile.SmoothSlope(originX + i, originY + j, true);
             if (WorldGen.SolidTile(originX + i, originY + j - 1) && GenBase._random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + i, originY + j, 165, false);
             }
             if (WorldGen.SolidTile(originX + i, originY + j) && GenBase._random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + i, originY + j - 1, 165, false);
             }
         }
     }
 }
Esempio n. 2
0
 private void PlaceSlab(MarbleBiome.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[(int)tile.type])
             {
                 tile.ResetToType(tile.type);
             }
             else
             {
                 tile.ResetToType((ushort)367);
             }
             bool active = slab.State(x, y, scale);
             tile.active(active);
             if (slab.HasWall)
             {
                 tile.wall = (byte)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, (ushort)165, false);
             }
             if (WorldGen.SolidTile(originX + x, originY + y) && GenBase._random.Next(4) == 0)
             {
                 WorldGen.PlaceTight(originX + x, originY + y - 1, (ushort)165, false);
             }
         }
     }
 }
Esempio n. 3
0
        private void SmoothSlope(int x, int y)
        {
            MarbleBiome.Slab slab = this._slabs[x, y];
            if (!slab.IsSolid)
            {
                return;
            }
            switch ((this._slabs[x, y - 1].IsSolid ? 1 : 0) << 3 | (this._slabs[x, y + 1].IsSolid ? 1 : 0) << 2 | (this._slabs[x - 1, y].IsSolid ? 1 : 0) << 1 | (this._slabs[x + 1, y].IsSolid ? 1 : 0))
            {
            case 4:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.HalfBrick));
                break;

            case 5:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomRightFilled));
                break;

            case 6:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomLeftFilled));
                break;

            case 9:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopRightFilled));
                break;

            case 10:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopLeftFilled));
                break;

            default:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.Solid));
                break;
            }
        }
Esempio n. 4
0
        private void SmoothSlope(int x, int y)
        {
            MarbleBiome.Slab slab = this._slabs[x, y];
            if (!slab.IsSolid)
            {
                return;
            }
            bool isSolid  = this._slabs[x, y - 1].IsSolid;
            bool flag     = this._slabs[x, y + 1].IsSolid;
            bool isSolid1 = this._slabs[x - 1, y].IsSolid;
            bool flag1    = this._slabs[x + 1, y].IsSolid;

            switch ((isSolid ? 1 : 0) << 3 | (flag ? 1 : 0) << 2 | (isSolid1 ? 1 : 0) << 1 | (flag1 ? 1 : 0))
            {
            case 4:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.HalfBrick));
                return;
            }

            case 5:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomRightFilled));
                return;
            }

            case 6:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomLeftFilled));
                return;
            }

            case 7:
            case 8:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.Solid));
                return;
            }

            case 9:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopRightFilled));
                return;
            }

            case 10:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopLeftFilled));
                return;
            }

            default:
            {
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.Solid));
                return;
            }
            }
        }
Esempio n. 5
0
        private void PlaceSlab(MarbleBiome.Slab slab, int originX, int originY, int scale)
        {
            ushort num1 = 367;
            ushort num2 = 178;

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

            for (int x = num3; x < num4; ++x)
            {
                if (x != num3 && x != num4 - 1 || WorldGen.genRand.Next(2) != 0)
                {
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        --num5;
                    }
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        ++num6;
                    }
                    for (int y = num5; y < num6; ++y)
                    {
                        Tile tile = GenBase._tiles[originX + x, originY + y];
                        tile.ResetToType(TileID.Sets.Ore[(int)tile.type] ? tile.type : num1);
                        bool active = slab.State(x, y, scale);
                        tile.active(active);
                        if (slab.HasWall)
                        {
                            tile.wall = num2;
                        }
                        WorldUtils.TileFrame(originX + x, originY + y, true);
                        WorldGen.SquareWallFrame(originX + x, originY + y, true);
                        Tile.SmoothSlope(originX + x, originY + y, true, false);
                        if (WorldGen.SolidTile(originX + x, originY + y - 1, false) && GenBase._random.Next(4) == 0)
                        {
                            WorldGen.PlaceTight(originX + x, originY + y, false);
                        }
                        if (WorldGen.SolidTile(originX + x, originY + y, false) && GenBase._random.Next(4) == 0)
                        {
                            WorldGen.PlaceTight(originX + x, originY + y - 1, false);
                        }
                    }
                }
            }
        }
Esempio n. 6
0
        // Token: 0x06000FAE RID: 4014 RVA: 0x003F7584 File Offset: 0x003F5784
        private void SmoothSlope(int x, int y)
        {
            MarbleBiome.Slab slab = this._slabs[x, y];
            if (!slab.IsSolid)
            {
                return;
            }
            bool arg_6B_0 = this._slabs[x, y - 1].IsSolid;
            bool isSolid  = this._slabs[x, y + 1].IsSolid;
            bool isSolid2 = this._slabs[x - 1, y].IsSolid;
            bool isSolid3 = this._slabs[x + 1, y].IsSolid;

            switch ((arg_6B_0 ? 1 : 0) << 3 | (isSolid ? 1 : 0) << 2 | (isSolid2 ? 1 : 0) << 1 | (isSolid3 ? 1 : 0))
            {
            case 4:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.HalfBrick));
                return;

            case 5:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomRightFilled));
                return;

            case 6:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.BottomLeftFilled));
                return;

            case 9:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopRightFilled));
                return;

            case 10:
                this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.TopLeftFilled));
                return;
            }
            this._slabs[x, y] = slab.WithState(new MarbleBiome.SlabState(MarbleBiome.SlabStates.Solid));
        }