public void HillGen(int baseSize, int height, int stretchX, int stretchY, int stretchBase) { AreaGen area = new AreaGen(); area.StretchedMazeGen(baseSize, 0.5, stretchX, stretchY, stretchBase, false, 1, 0.10, 1, 0); Width = area.Width; Height = area.Height; _tiles = area._tiles; Center = area.Center; area.FillCorners(); for (int k = 1; k <= height; k++) { int skx = (stretchX - 1) * k * 5 / stretchX; int sky = (stretchY - 1) * k * 5 / stretchY; AreaGen area2 = new AreaGen(); area2.StretchedMazeGen((int)(baseSize * Math.Pow(0.6, Math.Pow(k, 1.5))), 0.5, stretchX + skx, stretchY + sky, (int)(stretchBase * 0.9 / (k + 1)), false, 1, 0.15, 1, 0); area2.FillCorners(); for (int i = 0; i < area2.Width; i++) { for (int j = 0; j < area2.Height; j++) { if (area2._tiles[i, j] != AreaTileType.Depth) { _tiles[Center.X - area2.Center.X + i, Center.Y - area2.Center.Y + j] = area2._tiles[i, j]; } } } } }
private void Sea(int x, int y, int stretchX, int stretchY, int stretchBase, int size) { AreaGen area = new AreaGen(); area.StretchedMazeGen(size, 3, stretchX, stretchY, stretchBase, false, 4, 1, 0.9, 0.7); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { int worldX = x - area.Center.X + i; int worldY = y - area.Center.Y + j; if (GetGround(worldX, worldY) == GroundTileType.Undefined) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(worldX, worldY, GroundTileType.Sea); break; case AreaTileType.Wall: SetGround(worldX, worldY, GroundTileType.Ground); break; default: break; } } } } }
private void Coast(int x, int y, int stretchX, int stretchY, int stretchBase, int size) { AreaGen area = new AreaGen(); area.StretchedMazeGen(size, 3, stretchX, stretchY, stretchBase, false, 2, 1, 0, 0.7); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Sea); break; case AreaTileType.Wall: SetTile(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Sea, ObjectTileType.Rock); break; default: break; } } } }