Ejemplo n.º 1
0
        public void VanillaHell(GenerationProgress progress)
        {
            progress.Message = Language.GetTextValue("LegacyGen.18");
            progress.Set(0f);
            int num = Main.maxTilesY - WorldGen.genRand.Next(150, 190);

            for (int k = 0; k < Main.maxTilesX; k++)
            {
                num += WorldGen.genRand.Next(-3, 4);
                if (num < Main.maxTilesY - 190)
                {
                    num = Main.maxTilesY - 190;
                }
                if (num > Main.maxTilesY - 160)
                {
                    num = Main.maxTilesY - 160;
                }
                for (int l = num - 20 - WorldGen.genRand.Next(3); l < Main.maxTilesY; l++)
                {
                    if (l >= num)
                    {
                        Main.tile[k, l].active(false);
                        Main.tile[k, l].lava(false);
                        Main.tile[k, l].liquid = 0;
                    }
                    else
                    {
                        Main.tile[k, l].type = 57;
                    }
                }
            }
            int num2 = Main.maxTilesY - WorldGen.genRand.Next(40, 70);

            for (int m = 10; m < Main.maxTilesX - 10; m++)
            {
                num2 += WorldGen.genRand.Next(-10, 11);
                if (num2 > Main.maxTilesY - 60)
                {
                    num2 = Main.maxTilesY - 60;
                }
                if (num2 < Main.maxTilesY - 100)
                {
                    num2 = Main.maxTilesY - 120;
                }
                for (int n = num2; n < Main.maxTilesY - 10; n++)
                {
                    if (!Main.tile[m, n].active())
                    {
                        Main.tile[m, n].lava(true);
                        Main.tile[m, n].liquid = 255;
                    }
                }
            }
            for (int num3 = 0; num3 < Main.maxTilesX; num3++)
            {
                if (WorldGen.genRand.Next(50) == 0)
                {
                    int num4 = Main.maxTilesY - 65;
                    while (!Main.tile[num3, num4].active() && num4 > Main.maxTilesY - 135)
                    {
                        num4--;
                    }
                    WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), num4 + WorldGen.genRand.Next(20, 50), (double)WorldGen.genRand.Next(15, 20), 1000, 57, true, 0f, (float)WorldGen.genRand.Next(1, 3), true, true);
                }
            }
            Liquid.QuickWater(-2, -1, -1);
            for (int num5 = 0; num5 < Main.maxTilesX; num5++)
            {
                float num6 = (float)num5 / (float)(Main.maxTilesX - 1);
                progress.Set(num6 / 2f + 0.5f);
                if (WorldGen.genRand.Next(13) == 0)
                {
                    int num7 = Main.maxTilesY - 65;
                    while ((Main.tile[num5, num7].liquid > 0 || Main.tile[num5, num7].active()) && num7 > Main.maxTilesY - 140)
                    {
                        num7--;
                    }
                    WorldGen.TileRunner(num5, num7 - WorldGen.genRand.Next(2, 5), (double)WorldGen.genRand.Next(5, 30), 1000, 57, true, 0f, (float)WorldGen.genRand.Next(1, 3), true, true);
                    float num8 = (float)WorldGen.genRand.Next(1, 3);
                    if (WorldGen.genRand.Next(3) == 0)
                    {
                        num8 *= 0.5f;
                    }
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.TileRunner(num5, num7 - WorldGen.genRand.Next(2, 5), (double)((int)((float)WorldGen.genRand.Next(5, 15) * num8)), (int)((float)WorldGen.genRand.Next(10, 15) * num8), 57, true, 1f, 0.3f, false, true);
                    }
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        num8 = (float)WorldGen.genRand.Next(1, 3);
                        WorldGen.TileRunner(num5, num7 - WorldGen.genRand.Next(2, 5), (double)((int)((float)WorldGen.genRand.Next(5, 15) * num8)), (int)((float)WorldGen.genRand.Next(10, 15) * num8), 57, true, -1f, 0.3f, false, true);
                    }
                    WorldGen.TileRunner(num5 + WorldGen.genRand.Next(-10, 10), num7 + WorldGen.genRand.Next(-10, 10), (double)WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(5, 10), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true);
                    if (WorldGen.genRand.Next(3) == 0)
                    {
                        WorldGen.TileRunner(num5 + WorldGen.genRand.Next(-10, 10), num7 + WorldGen.genRand.Next(-10, 10), (double)WorldGen.genRand.Next(10, 30), WorldGen.genRand.Next(10, 20), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true);
                    }
                    if (WorldGen.genRand.Next(5) == 0)
                    {
                        WorldGen.TileRunner(num5 + WorldGen.genRand.Next(-15, 15), num7 + WorldGen.genRand.Next(-15, 10), (double)WorldGen.genRand.Next(15, 30), WorldGen.genRand.Next(5, 20), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true);
                    }
                }
            }
            for (int num9 = 0; num9 < Main.maxTilesX; num9++)
            {
                WorldGen.TileRunner(WorldGen.genRand.Next(20, Main.maxTilesX - 20), WorldGen.genRand.Next(Main.maxTilesY - 180, Main.maxTilesY - 10), (double)WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(2, 7), -2, false, 0f, 0f, false, true);
            }
            for (int num10 = 0; num10 < Main.maxTilesX; num10++)
            {
                if (!Main.tile[num10, Main.maxTilesY - 145].active())
                {
                    Main.tile[num10, Main.maxTilesY - 145].liquid = 255;
                    Main.tile[num10, Main.maxTilesY - 145].lava(true);
                }
                if (!Main.tile[num10, Main.maxTilesY - 144].active())
                {
                    Main.tile[num10, Main.maxTilesY - 144].liquid = 255;
                    Main.tile[num10, Main.maxTilesY - 144].lava(true);
                }
            }
            for (int num11 = 0; num11 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008); num11++)
            {
                WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(Main.maxTilesY - 140, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(3, 7), 58, false, 0f, 0f, false, true);
            }
            WorldGen.AddHellHouses();
        }