Exemplo n.º 1
0
        // Note that this item does not work in Multiplayer, but serves as a learning tool for other things.
        public override bool UseItem(Player player)
        {
            int x = (int)(player.position.X / 16);
            int y = (int)(player.position.Y / 16) + 3;

            WorldMethods.TileRunner(x, y, (double)200, 1, mod.TileType("CanyonRock"), false, 0f, 0f, true, true);             //improve basic shape later

            WorldMethods.RoundHole(x, y - 20, 60, 30, 10, true);
            for (int i = 0; i < 3; i++)
            {
                int Ex        = Main.rand.Next(-35, 35);
                int height    = Main.rand.Next(30, 80);
                int BaseWidth = Main.rand.Next(60, 80);
                int Sway      = 0;
                for (int j = 15; j < height; j++)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Sway -= 1;
                        }
                        else
                        {
                            Sway += 1;
                        }
                    }
                    WorldMethods.TileRunner((x + Ex) + Sway, (y + 10) + j, (double)25 + (BaseWidth / Math.Sqrt(j)), 1, mod.TileType("CanyonRock"), false, 0f, 0f, true, true);                    //improve basic shape later
                    WorldGen.digTunnel((x + Ex) + Sway, (y + 10) + j, 0, 0, 3, (int)(BaseWidth / Math.Sqrt(j)), false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        public static void Asteroid(int X, int Y, int size, ushort type)
        {
            //Main.NewText("asteroid", 100, 220, 100);
            WorldMethods.TileRunner(X, Y, (double)size * 2f, 1, type, true, 0f, 0f, true, true);

            for (int rotation2 = 0; rotation2 < 350; rotation2++)
            {
                int DistX = (int)(0 - (Math.Sin(rotation2) * size));
                int DistY = (int)(0 - (Math.Cos(rotation2) * size));
                WorldMethods.TileRunner(X + DistX, Y + DistY, (double)size * 0.75f, 1, type, true, 0f, 0f, true, true);
            }
        }
Exemplo n.º 3
0
        public void PlaceCanyon(int x, int y)
        {
            int canyonRockTile = mod.TileType <Tiles.CanyonRock>();

            WorldMethods.TileRunner(x, y, (double)200, 1, mod.TileType("CanyonRock"), false, 0f, 0f, true, true); //improve basic shape later

            WorldMethods.RoundHole(x, y - 20, 60, 30, 10, true);

            for (int i = 0; i < 3; i++)
            {
                int Ex        = Main.rand.Next(-35, 35);
                int height    = Main.rand.Next(30, 80);
                int BaseWidth = Main.rand.Next(60, 80);
                int Sway      = 0;
                for (int j = 15; j < height; j++)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Sway -= 1;
                        }
                        else
                        {
                            Sway += 1;
                        }
                    }
                    WorldMethods.TileRunner((x + Ex) + Sway, (y + 10) + j, (double)25 + (BaseWidth / Math.Sqrt(j)), 1, mod.TileType("CanyonRock"), false, 0f, 0f, true, true); //improve basic shape later
                    WorldGen.digTunnel((x + Ex) + Sway, (y + 10) + j, 0, 0, 3, (int)(BaseWidth / Math.Sqrt(j)), false);

                    /*for (int h = -10; h < 10; h++)
                     *                  {
                     *                          WorldGen.KillWall((x + Ex) + Sway + h, (y + 10) + j);
                     *
                     *                  }*/
                }
            }
        }
Exemplo n.º 4
0
        public void PlaceReachs(int x, int y)
        {
            Tile tile   = Main.tile[1, 1];
            int  startx = x; //keep track of starting position
            int  starty = y;
            int  x1213  = 300;
            int  z1592  = 147;

            if (Main.maxTilesX == 4200)
            {
                x1213 = 300;
            }
            else if (Main.maxTilesX == 6400)
            {
                x1213 = 400;
            }
            else if (Main.maxTilesX == 8400)
            {
                x1213 = 520;
            }
            if (Main.maxTilesX == 4200)
            {
                z1592 = 147;
            }
            else if (Main.maxTilesX == 6400)
            {
                z1592 = 196;
            }
            else if (Main.maxTilesX == 8400)
            {
                z1592 = 263;
            }
            for (int z = 0; z < z1592; z++)
            {
                if (Main.rand.Next(2) == 1)
                {
                    WorldMethods.TileRunner(x, y + z, (double)x1213, 1, ModContent.TileType <ReachGrassTile>(), false, 0f, 0f, true, true); //Basic grass shape. Will be improved later. Specifically, make it only override certain tiles, and make it fill in random holes in the ground.
                }
            }
            int E = Main.maxTilesX;
            int F = (int)Main.maxTilesY;

            tile = Framing.GetTileSafely(E, F);
            if (tile.type == ModContent.TileType <ReachGrassTile>())
            {
                WorldGen.GrowTree(E, F);
            }
            //temporary wall placement until i get a better method
            for (int A = x - (int)x1213 / 2; A < x + (int)x1213 / 2; A++)
            {
                for (int B = y + 10; B < y + 1000; B++)
                {
                    if (Main.tile[A, B] != null)
                    {
                        int Wal = (int)Main.tile[A, B].wall;
                        if (Main.tile[A, B].type == ModContent.TileType <ReachGrassTile>() && ((Wal == 2 || Wal == 54 || Wal == 55 || Wal == 56 || Wal == 57 || Wal == 58 || Wal == 59 || Wal == 0 && B >= WorldGen.rockLayer - 10))) // A = x, B = y.
                        {
                            if (WorldGen.genRand.Next(2) == 0)
                            {
                                WorldGen.KillWall(A, B);
                                WorldGen.PlaceWall(A, B, ModContent.WallType <ReachWallNatural>());
                            }
                            else if (WorldGen.genRand.Next(2) == 0 && B > WorldGen.rockLayer - 20)
                            {
                                WorldGen.KillWall(A, B);
                                WorldGen.PlaceWall(A, B, ModContent.WallType <ReachStoneWall>());
                            }
                            else
                            {
                                WorldGen.KillWall(A, B);
                                WorldGen.PlaceWall(A, B, 15);
                            }
                        }
                    }
                }
            }

            int smoothness      = 3;                      //how smooth the tunnels are
            int chestrarity     = 7;                      //how rare chests are
            int depth           = 50;                     //how many vertical tunnels deep the initial goes.
            int tunnelheight    = Main.rand.Next(65, 80); //how high the first tunnel is
            int tunnelthickness = 5;

            for (int q = 0; q < 10; q++) //make 2 tunnels to overlap
            {
                if (startx == x && starty == y)
                {
                    if (Main.maxTilesX == 4200)
                    {
                        tunnelheight = Main.rand.Next(30, 50);
                    }
                    else if (Main.maxTilesX == 6400)
                    {
                        tunnelheight = Main.rand.Next(80, 100);
                    }
                    else if (Main.maxTilesX == 8400)
                    {
                        tunnelheight = Main.rand.Next(90, 120);
                    }
                    tunnelthickness = 5;
                }
                int jt      = 0; //j placeholder to use out of loop
                int newx    = startx;
                int newy    = starty - 40;
                int tunnelX = Main.rand.Next(-55, 55); //how far away on the x axis each tunnel starts
                for (int p = 0; p < depth; p++)
                {
                    int k = 0;       //placeholder
                    if (tunnelX > 0) //if tunnel leads right
                    {
                        for (k = newx; k < newx + tunnelX; k++)
                        {
                            for (int e = 0; e < smoothness; e++)
                            {
                                WorldGen.digTunnel(k, newy, 0, 0, 1, tunnelthickness, false); //horizontal tunneling
                                if (Main.rand.Next(5) == 0)
                                {
                                    WorldGen.TileRunner(k, newy, 9, 1, 48, false, 0f, 0f, false, true);
                                    WorldGen.TileRunner(k, newy, 9, 1, 48, false, 0f, 0f, false, true);
                                }
                            }

                            if (Main.rand.Next(20) == 1) //make a full branch
                            {
                                startx = k;
                                starty = newy;
                                depth  = (depth - p) + 1;
                            }
                        }
                    }
                    else if (tunnelX < 0)  //if tunnel should lead left
                    {
                        for (k = newx; k > newx + tunnelX; k--)
                        {
                            for (int e = 0; e < smoothness; e++)
                            {
                                WorldGen.digTunnel(k, newy, 0, 0, 1, tunnelthickness, false); //horizontal tunneling
                            }
                            if (Main.rand.Next(18) == 1)                                      //make a full branch
                            {
                                startx = k;
                                starty = newy;
                                depth  = (depth - p) + 1;
                            }
                        }
                    }
                    tunnelthickness = Main.rand.Next(3, 7);
                    for (int j = 0; j < tunnelheight; j++) //go down the tunnel
                    {
                        for (int e = 0; e < smoothness; e++)
                        {
                            WorldGen.digTunnel(newx + tunnelX, newy + j, 0, 0, 1, tunnelthickness, false); //vertical tunneling
                            if (Main.rand.Next(2) == 0)
                            {
                                WorldGen.TileRunner(newx + tunnelX, newy + j, 9, 1, 48, false, 0f, 0f, false, true);
                            }
                            WorldGen.TileRunner(newx + tunnelX, newy + j, 9, 1, 48, false, 0f, 0f, false, true);
                        }
                        jt = j;
                    }
                    tunnelheight    = Main.rand.Next(20, 40); //how high the first tunnel is
                    tunnelthickness = Main.rand.Next(3, 7);
                    newx            = newx + tunnelX;         //setting values to new places
                    newy            = newy + jt;
                    if (Main.rand.Next(2) == 1)
                    {
                        tunnelX = Main.rand.Next(15, 50); //how far the horizontal tunnel goes
                    }
                    else
                    {
                        tunnelX = Main.rand.Next(-50, -15); //how far the horizontal tunnel goes
                    }

                    if (newx > x + 70) //if it strays too far on the x axis
                    {
                        tunnelX = Main.rand.Next(-75, -55);
                    }
                    if (newx < x - 70)
                    {
                        tunnelX = Main.rand.Next(55, 75);
                    }
                }
            }
            for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY * 27) * 15E-05); k++)
            {
                int zx = WorldGen.genRand.Next(0, Main.maxTilesX);
                int zy = WorldGen.genRand.Next(0, Main.maxTilesY);
                if (Main.tile[zx, zy] != null)
                {
                    if (Main.tile[zx, zy].active())
                    {
                        if (Main.tile[zx, zy].type == ModContent.TileType <ReachGrassTile>())
                        {
                            WorldGen.TileRunner(zx, zy, (double)WorldGen.genRand.Next(5, 12), WorldGen.genRand.Next(5, 12), ModContent.TileType <MossyStone>(), false, 0f, 0f, false, true);
                        }
                    }
                }
            }
            for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY * 9) * 15E-05); k++)
            {
                int zx = WorldGen.genRand.Next(0, Main.maxTilesX);
                int zy = WorldGen.genRand.Next(0, Main.maxTilesY);
                if (Main.tile[zx, zy] != null)
                {
                    if (Main.tile[zx, zy].active())
                    {
                        if (Main.tile[zx, zy].type == ModContent.TileType <ReachGrassTile>())
                        {
                            WorldGen.TileRunner(zx, zy, (double)WorldGen.genRand.Next(4, 6), WorldGen.genRand.Next(4, 6), WorldGen.CopperTierOre, false, 0f, 0f, false, true);
                        }
                    }
                }
            }
            for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY * 8) * 15E-05); k++)
            {
                int zx = WorldGen.genRand.Next(0, Main.maxTilesX);
                int zy = WorldGen.genRand.Next(0, Main.maxTilesY);
                if (Main.tile[zx, zy] != null)
                {
                    if (Main.tile[zx, zy].active())
                    {
                        if (Main.tile[zx, zy].type == ModContent.TileType <ReachGrassTile>())
                        {
                            WorldGen.TileRunner(zx, zy, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), WorldGen.IronTierOre, false, 0f, 0f, false, true);
                        }
                    }
                }
            }
            for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY * 4) * 15E-05); k++)
            {
                int zx = WorldGen.genRand.Next(0, Main.maxTilesX);
                int zy = WorldGen.genRand.Next((int)Main.worldSurface + 10, Main.maxTilesY);
                if (Main.tile[zx, zy] != null)
                {
                    if (Main.tile[zx, zy].active())
                    {
                        if (Main.tile[zx, zy].type == ModContent.TileType <ReachGrassTile>())
                        {
                            WorldGen.TileRunner(zx, zy, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), WorldGen.SilverTierOre, false, 0f, 0f, false, true);
                        }
                    }
                }
            }
            for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY * 2) * 15E-05); k++)
            {
                int zx = WorldGen.genRand.Next(0, Main.maxTilesX);
                int zy = WorldGen.genRand.Next((int)Main.worldSurface + 20, Main.maxTilesY);
                if (Main.tile[zx, zy] != null)
                {
                    if (Main.tile[zx, zy].active())
                    {
                        if (Main.tile[zx, zy].type == ModContent.TileType <ReachGrassTile>())
                        {
                            WorldGen.TileRunner(zx, zy, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), WorldGen.GoldTierOre, false, 0f, 0f, false, true);
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        public void PlaceVolcano(int x, int y)
        {
            //some notes:
            //It is the same on every worldsize. This will be fixed.
            //It doesn't merge with the ground well AT ALL. This will also be fixed.
            //The elevation is kinda f****d.
            //Most of the values are arbituary.
            //The code does need to be cleaned up. I'll do that in the final version.
            //Most of the methods I use are in WorldMethods. Its a file i copypaste in any worldgen project I do, so it may have some unused methods.


            //basic land of the area.

            for (int depth = 0; depth < 100; depth++)
            {
                if (Main.rand.Next(6) == 1)
                {
                    WorldMethods.TileRunner(x, y + depth, (double)125 + Main.rand.Next(75), 1, mod.TileType("VolcanoTile"), false, 0f, 0f, true, true);             //improve basic shape later
                }
            }

            //random bits of lava above ground, that fall. Despite not being the "prettiest" method, it probably looks and works the best.
            for (int r = 0; r < 250; r++)
            {
                Tile tile = Main.tile[x + Main.rand.Next(-75, 75), y - Main.rand.Next(10, 85)];
                tile.liquid = 255;
                tile.lava(true);
            }
            //A line of consecutive "spikes" along the ground.
            for (int k = x - 85; k < x + 85; k++)
            {
                WorldMethods.CragSpike(k, (int)(y - Main.rand.Next(10, 28)), 1, 30, (ushort)mod.TileType("VolcanoStone"), (float)Main.rand.Next(2, 6), (float)Main.rand.Next(2, 6));
            }

            //the main volcano
            WorldMethods.MainVolcano(x, (int)(y - Main.rand.Next(70, 90)), 3, 130, (ushort)mod.TileType("VolcanoStone"), (float)(Main.rand.Next(400, 600) / 100), (float)(Main.rand.Next(400, 600) / 100));

            //digs the tunnel down the middle
            for (int j = y - 100; j < y + 20; j++)
            {
                WorldGen.digTunnel(x, j, 0, 0, 8, (int)(5 + (Math.Sqrt((j + 100) - y) / 1.5f)), false);
            }
            //giant gaping hole you see at the bottom.
            WorldMethods.RoundHole(x, y + 30, 17, 7, 10, true);

            //more random lava bits.
            for (int r = 0; r < 2000; r++)
            {
                Tile tile = Main.tile[x + Main.rand.Next(-30, 30), y + Main.rand.Next(-20, 45)];
                tile.liquid = 255;
                tile.lava(true);
            }

            //generates the ore
            for (int OreGen = 0; OreGen < 100; OreGen++)
            {
                int orex = x + Main.rand.Next(-75, 75);
                int orey = y + Main.rand.Next(-20, 300);
                if (Main.tile[orex, orey].type == mod.TileType("VolcanoStone"))
                {
                    WorldGen.TileRunner(orex, orey, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), mod.TileType("MoltenOre"), false, 0f, 0f, false, true);
                }                                                          // A = x, B = y.
            }

            //Turns nearby water into lava.
            for (int LiquidX = -110; LiquidX < 110; LiquidX++)
            {
                for (int LiquidY = -20; LiquidY < 150; LiquidY++)
                {
                    Tile tile = Main.tile[x + LiquidX, y + LiquidY];
                    if (tile.liquid > 0)
                    {
                        tile.lava(true);
                    }
                }
            }
        }
Exemplo n.º 6
0
        public void PlaceCrystalForest(int x, int y)
        {
            //initial pit
            WorldMethods.TileRunner(x, y, (double)150, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, true, true); //improve basic shape later
            bool leftpit = false;
            int  PitX;
            int  PitY;

            if (Main.rand.Next(2) == 0)
            {
                leftpit = true;
            }
            if (leftpit)
            {
                PitX = x - Main.rand.Next(5, 15);
            }
            else
            {
                PitX = x + Main.rand.Next(5, 15);
            }
            for (PitY = y - 16; PitY < y + 25; PitY++)
            {
                WorldGen.digTunnel(PitX, PitY, 0, 0, 1, 4, false);
                WorldGen.TileRunner(PitX, PitY, 11, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
            }
            //tunnel off of pit
            int tunnellength = Main.rand.Next(50, 110);
            int TunnelEndX   = 0;

            if (leftpit)
            {
                for (int TunnelX = PitX; TunnelX < PitX + tunnellength; TunnelX++)
                {
                    WorldGen.digTunnel(TunnelX, PitY, 0, 0, 1, 4, false);
                    WorldGen.TileRunner(TunnelX, PitY, 13, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
                    TunnelEndX = TunnelX;
                }
            }
            else
            {
                for (int TunnelX = PitX; TunnelX > PitX - tunnellength; TunnelX--)
                {
                    WorldGen.digTunnel(TunnelX, PitY, 0, 0, 1, 4, false);
                    WorldGen.TileRunner(TunnelX, PitY, 13, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
                    TunnelEndX = TunnelX;
                }
            }
            //More pits and spikes
            int TrapX;

            for (int TrapNum = 0; TrapNum < 10; TrapNum++)
            {
                if (leftpit)
                {
                    TrapX = Main.rand.Next(PitX, PitX + tunnellength);
                }
                else
                {
                    TrapX = Main.rand.Next(PitX - tunnellength, PitX);
                }
                for (int TrapY = PitY; TrapY < PitY + 15; TrapY++)
                {
                    WorldGen.digTunnel(TrapX, TrapY, 0, 0, 1, 3, false);
                    WorldGen.TileRunner(TrapX, TrapY, 11, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
                }
                WorldGen.TileRunner(TrapX, PitY + 18, 9, 1, 48, false, 0f, 0f, false, true);
            }
            //Additional hole and tunnel
            int PittwoY = 0;

            for (PittwoY = PitY; PittwoY < PitY + 40; PittwoY++)
            {
                WorldGen.digTunnel(TunnelEndX, PittwoY, 0, 0, 1, 4, false);
                WorldGen.TileRunner(TunnelEndX, PittwoY, 11, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
            }
            int PittwoX = 0;

            for (PittwoX = TunnelEndX - 50; PittwoX < TunnelEndX + 50; PittwoX++)
            {
                WorldGen.digTunnel(PittwoX, PittwoY, 0, 0, 1, 4, false);
                WorldGen.TileRunner(PittwoX, PittwoY, 13, 1, mod.TileType("ReachGrassTile"), false, 0f, 0f, false, true);
                WorldGen.PlaceChest(PittwoX, PittwoY, 21, false, 2);
                WorldGen.PlaceChest(PittwoX + 5, PittwoY + 3, 21, false, 2);
                WorldGen.PlaceChest(PittwoX + 1, PittwoY + 2, 21, false, 2);
            }
            //grass walls
            for (int wallx = x - 100; wallx < x + 100; wallx++)
            {
                for (int wally = y - 25; wally < y + 100; wally++)
                {
                    if (Main.tile[wallx, wally].wall != 0)
                    {
                        WorldGen.KillWall(wallx, wally);
                        WorldGen.PlaceWall(wallx, wally, 63);
                    }
                }
            }
            //campfires and shit
            int  SkullStickY = 0;
            Tile tile        = Main.tile[1, 1];

            for (int SkullStickX = x - 90; SkullStickX < x + 90; SkullStickX++)
            {
                if (Main.rand.Next(4) == 1)
                {
                    for (SkullStickY = y - 80; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0)
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, 215);//i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, 215);
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, 215);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, 215, 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, 215, 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, 215, 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(9) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 3, mod.TileType("SkullStick")); //i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, mod.TileType("SkullStick"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, mod.TileType("SkullStick"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, mod.TileType("SkullStick"));
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 3, mod.TileType("SkullStick"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, mod.TileType("SkullStick"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, mod.TileType("SkullStick"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, mod.TileType("SkullStick"), 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(12) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 3, mod.TileType("SkullStick2")); //i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, mod.TileType("SkullStick2"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, mod.TileType("SkullStick2"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, mod.TileType("SkullStick2"));
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 3, mod.TileType("SkullStick2"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, mod.TileType("SkullStick2"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, mod.TileType("SkullStick2"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, mod.TileType("SkullStick2"), 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(10) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 3, mod.TileType("SkullStick3")); //i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, mod.TileType("SkullStick3"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, mod.TileType("SkullStick3"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, mod.TileType("SkullStick3"));
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 3, mod.TileType("SkullStick3"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, mod.TileType("SkullStick3"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, mod.TileType("SkullStick3"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, mod.TileType("SkullStick3"), 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(25) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 3, mod.TileType("CreationAltarTile")); //i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, mod.TileType("CreationAltarTile"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, mod.TileType("CreationAltarTile"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, mod.TileType("CreationAltarTile"));
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 3, mod.TileType("CreationAltarTile"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, mod.TileType("CreationAltarTile"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, mod.TileType("CreationAltarTile"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, mod.TileType("CreationAltarTile"), 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(10) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 3, mod.TileType("ReachGrass1")); //i dont know which of these is correct but i cant be bothered to test.
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 2, mod.TileType("ReachGrass1"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY - 1, mod.TileType("ReachGrass1"));
                            WorldGen.PlaceObject(SkullStickX, SkullStickY, mod.TileType("ReachGrass1"));
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 3, mod.TileType("ReachGrass1"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 2, mod.TileType("ReachGrass1"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY - 1, mod.TileType("ReachGrass1"), 0, 0, -1, -1);
                            NetMessage.SendObjectPlacment(-1, SkullStickX, SkullStickY, mod.TileType("ReachGrass1"), 0, 0, -1, -1);
                        }
                    }
                }
                if (Main.rand.Next(16) == 1)
                {
                    for (SkullStickY = y - 60; SkullStickY < y + 75; SkullStickY++)
                    {
                        tile = Main.tile[SkullStickX, SkullStickY];
                        if (tile.type == 2 || tile.type == 1 || tile.type == 0 || tile.type == mod.TileType("ReachGrassTile"))
                        {
                            WorldGen.PlaceChest(SkullStickX, SkullStickY - 3, (ushort)mod.TileType("ReachChest"), false, 0);
                            WorldGen.PlaceChest(SkullStickX, SkullStickY - 2, (ushort)mod.TileType("ReachChest"), false, 0);
                            WorldGen.PlaceChest(SkullStickX, SkullStickY - 1, (ushort)mod.TileType("ReachChest"), false, 0);
                        }
                    }
                }
            }
            //loot placement
            for (PittwoX = TunnelEndX - 20; PittwoX < TunnelEndX + 20; PittwoX++)
            {
                if (Main.rand.Next(30) == 1)
                {
                    Main.tile[PittwoX, PittwoY + 1].active(true);
                    Main.tile[PittwoX + 1, PittwoY + 1].active(true);
                    Main.tile[PittwoX, PittwoY + 1].type     = 1;
                    Main.tile[PittwoX + 1, PittwoY + 1].type = 1;
                    WorldGen.AddLifeCrystal(PittwoX + 1, PittwoY);
                    WorldGen.AddLifeCrystal(PittwoX + 1, PittwoY + 1);
                    break;
                }
            }
            for (int trees = 0; trees < 5000; trees++)
            {
                int E = x + Main.rand.Next(-200, 200);
                int F = y + Main.rand.Next(-30, 30);
                tile = Framing.GetTileSafely(E, F);
                if (tile.type == mod.TileType("ReachGrassTile"))
                {
                    WorldGen.GrowTree(E, F);
                }
            }
        }