Example #1
0
        public override bool AltFunctionUse(Player player)
        {
            TUAPlayer.endPoint = Main.MouseWorld / 16;
            Biomes <SolarVolcano> .Place((int)player.Center.X / 16, (int)player.Center.Y / 16 - 4, new StructureMap());

            //SolarDungeon.PlaceALine(TUAPlayer.initialPoint, TUAPlayer.endPoint);
            //SolarDungeon.PlaceRoomBox((int)(TUAPlayer.endPoint.X - 75 / 2), (int)(TUAPlayer.endPoint.Y - 15), 75, 30, 5);

            /*SolarDungeon.GenerateSpike(TUAPlayer.initialPoint);
             * TUAPlayer.initialPoint = TUAPlayer.endPoint;
             * Main.NewText("Line placed");*/
            return(true);
        }
Example #2
0
        public void WastelandGeneration(GenerationProgress progress)
        {
            progress.Message = "Eradiating the underworld";
            progress.Set(0f);

            int  maxAmplitude  = 15;
            int  waveAmplitude = 10;
            int  originY       = 100;
            bool inverted      = false;
            int  startingY     = 175;

            // bool generateLiquid = false;
            for (int x = 0; x < Main.maxTilesX; x++)
            {
                for (int y = Main.maxTilesY - 200; y < Main.maxTilesY; y++)
                {
                    Main.tile[x, y].type   = (ushort)ModContent.TileType <WastelandRock>();
                    Main.tile[x, y].liquid = 0;
                    Main.tile[x, y].active(true);
                    Main.tile[x, y].wall = 0;

                    if (y > Main.maxTilesY - startingY)
                    {
                        Main.tile[x, y].active(false);
                    }
                    if (y > Main.maxTilesY - originY + waveAmplitude)
                    {
                        Main.tile[x, y].active(true);
                        Main.tile[x, y].type = (ushort)ModContent.TileType <WastelandRock>();
                    }
                }

                if (WorldGen.genRand.Next(5) == 0)
                {
                    if (!inverted)
                    {
                        waveAmplitude++;
                    }
                    else
                    {
                        waveAmplitude--;
                    }
                }


                if (waveAmplitude == 0)
                {
                    inverted = false;
                }

                if (waveAmplitude == maxAmplitude)
                {
                    inverted = true;
                    if (WorldGen.genRand.NextBool())
                    {
                        maxAmplitude += 3;
                    }
                    else if (maxAmplitude > 10)
                    {
                        maxAmplitude -= 3;
                    }
                }

                int modifyY = WorldGen.genRand.Next(10);
                if (modifyY == 0 && startingY > 160)
                {
                    startingY--;
                }
                else if (modifyY == 2 && startingY < 190)
                {
                    startingY++;
                }
            }
            for (int num11 = 0; num11 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008); num11++)
            {
                if (WorldGen.genRand.Next(50) == 0)
                {
                    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), ModContent.TileType <WastelandOre>(), false, 0f, 0f, false, true);
                }
            }
            GenerateSpikeTop();
            Biomes <HotWArena> .Place((int)Main.maxTilesX / 2, (int)Main.maxTilesY - 100, WorldGen.structures);
        }