using CalamityMod.Systems; using CalamityMod.Tiles.SunkenSea.Ambient; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class Shellstone : ModTile { public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); TileID.Sets.HasSlopeFrames[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Tink; DustType = DustID.CorruptPlants; AddMapEntry(new Color(123, 127, 170)); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } public override void RandomUpdate(int i, int j) { Tile Tile = Framing.GetTileSafely(i, j); Tile Below = Framing.GetTileSafely(i, j + 1); Tile Above = Framing.GetTileSafely(i, j - 1); if (!Below.HasTile && Below.LiquidType <= 0 && !Tile.BottomSlope) { if (Main.rand.NextBool(10)) { Below.TileType = (ushort)ModContent.TileType(); Below.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); } } } } } }