public override void Kill(int timeLeft)
        {
            Vector2 position = Projectile.Center;

            SoundEngine.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            // All the way across
            for (int x = 1; x <= Main.maxTilesX; x++)
            {
                // Six down, last is platforms
                for (int y = -5; y <= 0; y++)
                {
                    int xPosition = x;
                    int yPosition = (int)(y + position.Y / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || yPosition < 0 || yPosition >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, yPosition];

                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.ClearEverything(xPosition, yPosition);

                    if (y == 0)
                    {
                        FargoGlobalTile.ClearEverything(xPosition, yPosition, false);
                        // Spawn platforms
                        WorldGen.PlaceTile(xPosition, yPosition, TileID.Platforms, false, false, -1, 13);
                        if (Main.netMode == NetmodeID.Server)
                        {
                            NetMessage.SendTileSquare(-1, xPosition, yPosition, 1);
                        }
                    }
                    else
                    {
                        if (!FargoGlobalProjectile.TileIsLiterallyAir(tile))
                        {
                            FargoGlobalTile.ClearEverything(xPosition, yPosition);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Kill(int timeLeft)
        {
            Vector2 position = Projectile.Center;

            SoundEngine.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            // Seven across
            for (int x = -3; x <= 3; x++)
            {
                for (int y = (int)(1 + position.Y / 16.0f); y <= (Main.maxTilesY - 40); y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, y];

                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.ClearEverything(xPosition, y, false);

                    // Spawn structure
                    WorldGen.PlaceWall(xPosition, y, WallID.Stone);

                    if ((x == -3) || (x == 3))
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.GrayBrick);
                    }
                    else if ((x == -2 || x == 2) && (y % 10 == 0))
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.Torches);
                    }
                    else if (x == 0)
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.Rope);
                    }

                    NetMessage.SendTileSquare(-1, xPosition, y, 1);
                }
            }
        }
Esempio n. 3
0
        public override void Kill(int timeLeft)
        {
            Main.PlaySound(SoundID.Item15, projectile.Center);
            Main.PlaySound(SoundID.Item14, projectile.Center);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            Vector2 position = projectile.Center;
            int     radius   = 60; //bigger = boomer

            for (int x = -radius; x <= (radius); x++)
            {
                for (int y = -radius * 2; y <= 0; y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);
                    int yPosition = (int)(y + position.Y / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || yPosition < 0 || yPosition >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, yPosition];
                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.FindChestTopLeft(xPosition, yPosition, true);

                    WorldGen.KillTile(xPosition, yPosition, noItem: true);
                    tile.liquid = 0;
                    tile.lava(false);
                    tile.honey(false);

                    if (Main.netMode == NetmodeID.Server)
                    {
                        NetMessage.sendWater(xPosition, yPosition);
                        NetMessage.SendTileSquare(-1, xPosition, yPosition, 1);
                    }
                }
            }

            Main.refreshMap = true;
        }
Esempio n. 4
0
        public override void Kill(int timeLeft)
        {
            Vector2 position = Projectile.Center;

            SoundEngine.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            //cavern height plus halfway to hell
            int yEndpoint = (int)(Main.rockLayer + (Main.maxTilesY - 200 - Main.rockLayer) / 2);

            // Five across
            for (int x = -2; x <= 2; x++)
            {
                for (int y = (int)(1 + position.Y / 16.0f); y <= yEndpoint; y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, y];

                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.ClearEverything(xPosition, y, false);

                    if (x == 0)
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.Rope);
                    }

                    NetMessage.SendTileSquare(-1, xPosition, y, 1);
                }
            }
        }
Esempio n. 5
0
        public override void Kill(int timeLeft)
        {
            SoundEngine.PlaySound(SoundID.Item15, Projectile.Center);
            SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            Vector2 position = Projectile.Center;
            int     radius   = 60; //bigger = boomer

            for (int x = -radius; x <= radius; x++)
            {
                for (int y = -radius * 2; y <= 0; y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);
                    int yPosition = (int)(y + position.Y / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || yPosition < 0 || yPosition >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, yPosition];
                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile) || FargoGlobalProjectile.TileIsLiterallyAir(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.ClearEverything(xPosition, yPosition);
                }
            }

            Main.refreshMap = true;
        }
Esempio n. 6
0
        public static void PlaceHouse(int x, int y, Vector2 position, int side, Player player)
        {
            int  xPosition = (int)((side * -1) + x + position.X / 16.0f);
            int  yPosition = (int)(y + position.Y / 16.0f);
            Tile tile      = Main.tile[xPosition, yPosition];

            // Testing for blocks that should not be destroyed
            if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
            {
                return;
            }

            int wallType      = WallID.Wood;
            int tileType      = TileID.WoodBlock;
            int platformStyle = 0;

            if (player.ZoneDesert && !player.ZoneBeach)
            {
                wallType      = WallID.Cactus;
                tileType      = TileID.CactusBlock;
                platformStyle = 25;
            }
            else if (player.ZoneSnow)
            {
                wallType      = WallID.BorealWood;
                tileType      = TileID.BorealWood;
                platformStyle = 19;
            }
            else if (player.ZoneJungle)
            {
                wallType      = WallID.RichMaogany;
                tileType      = TileID.RichMahogany;
                platformStyle = 2;
            }
            else if (player.ZoneCorrupt)
            {
                wallType      = WallID.Ebonwood;
                tileType      = TileID.Ebonwood;
                platformStyle = 1;
            }
            else if (player.ZoneCrimson)
            {
                wallType      = WallID.Shadewood;
                tileType      = TileID.Shadewood;
                platformStyle = 5;
            }
            else if (player.ZoneBeach)
            {
                wallType      = WallID.PalmWood;
                tileType      = TileID.PalmWood;
                platformStyle = 17;
            }
            else if (player.ZoneHallow)
            {
                wallType      = WallID.Pearlwood;
                tileType      = TileID.Pearlwood;
                platformStyle = 3;
            }
            else if (player.ZoneGlowshroom)
            {
                wallType      = WallID.Mushroom;
                tileType      = TileID.MushroomBlock;
                platformStyle = 18;
            }
            else if (player.ZoneSkyHeight)
            {
                wallType      = WallID.DiscWall;
                tileType      = TileID.Sunplate;
                platformStyle = 22;
            }
            else if (player.ZoneUnderworldHeight)
            {
                wallType      = WallID.ObsidianBrick;
                tileType      = TileID.ObsidianBrick;
                platformStyle = 13;
            }

            //dont act if the right blocks already above
            if ((y == -5) && (tile.type == TileID.Platforms || tile.type == tileType))
            {
                return;
            }

            if (x == 10 * side || x == 1 * side)
            {
                //dont act on correct block above/below door, destroying them will break it
                if ((y == -4 || y == 0) && tile.type == tileType)
                {
                    return;
                }

                if ((y == -1 || y == -2 || y == -3) && (tile.type == TileID.ClosedDoor || tile.type == TileID.OpenDoor))
                {
                    return;
                }
            }
            else //for blocks besides those on the left/right edges where doors are placed, its okay to have platform as floor
            {
                if (y == 0 && (tile.type == TileID.Platforms || tile.type == tileType))
                {
                    return;
                }
            }

            //doing it this way so the code still runs to place bg walls behind open door
            if (!((x == 9 * side || x == 2 * side) && (y == -1 || y == -2 || y == -3) && tile.type == TileID.OpenDoor))
            {
                FargoGlobalTile.ClearEverything(xPosition, yPosition);
            }

            // Spawn walls
            if (y != -5 && y != 0 && x != (10 * side) && x != (1 * side))
            {
                WorldGen.PlaceWall(xPosition, yPosition, wallType);
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendTileSquare(-1, xPosition, yPosition, 1);
                }
            }

            //platforms on top
            if (y == -5 && Math.Abs(x) >= 3 && Math.Abs(x) <= 5)
            {
                WorldGen.PlaceTile(xPosition, yPosition, TileID.Platforms, style: platformStyle);
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendData(MessageID.TileChange, -1, -1, null, 1, xPosition, yPosition, TileID.Platforms, platformStyle);
                }
            }
            // Spawn border
            else if ((y == -5) || (y == 0) || (x == (10 * side)) || (x == (1 * side) && y == -4))
            {
                WorldGen.PlaceTile(xPosition, yPosition, tileType);
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendTileSquare(-1, xPosition, yPosition, 1);
                }
            }
        }
Esempio n. 7
0
        public override void Kill(int timeLeft)
        {
            Vector2 position = projectile.Center;

            Main.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                return;
            }

            // Seven across
            for (int x = -3; x <= 3; x++)
            {
                for (int y = (int)(1 + position.Y / 16.0f); y <= (Main.maxTilesY - 40); y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);

                    if (xPosition < 0 || xPosition >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY)
                    {
                        continue;
                    }

                    Tile tile = Main.tile[xPosition, y];

                    if (tile == null)
                    {
                        continue;
                    }

                    if (!FargoGlobalProjectile.OkayToDestroyTile(tile))
                    {
                        continue;
                    }

                    FargoGlobalTile.ClearEverything(xPosition, y);

                    // Tile destroy

                    // WorldGen.KillTile(xPosition, y);
                    // WorldGen.KillWall(xPosition, y);
                    // Dust.NewDust(position, 22, 22, DustID.Smoke, 0.0f, 0.0f, 120);

                    // Kill liquids

                    /*if (tile != null)
                     * {
                     *  tile.liquid = 0;
                     *  tile.lava(false);
                     *  tile.honey(false);
                     *  if (Main.netMode == NetmodeID.Server)
                     *  {
                     *      NetMessage.sendWater(xPosition, y);
                     *  }
                     * }*/

                    // Spawn structure
                    WorldGen.PlaceWall(xPosition, y, WallID.Stone);

                    if ((x == -3) || (x == 3))
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.GrayBrick);
                    }

                    if ((x == -2 || x == 2) && (y % 10 == 0))
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.Torches);
                    }

                    if (x == 0)
                    {
                        WorldGen.PlaceTile(xPosition, y, TileID.Rope);
                    }

                    NetMessage.SendTileSquare(-1, xPosition, y, 1);
                }
            }
        }