using CalamityMod.Items.Placeables.DraedonStructures; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.Enums; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.DraedonStructures { public class InactivePowerCellFactory : ModTile { public const int Width = 4; public const int Height = 4; public const int OriginOffsetX = 0; // this tile is never placed by the player, so this makes for simpler code public const int OriginOffsetY = 3; public override void SetStaticDefaults() { Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Width = Width; TileObjectData.newTile.Height = Height; TileObjectData.newTile.Origin = new Point16(OriginOffsetX, OriginOffsetY); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; TileObjectData.newTile.CoordinatePadding = 0; TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(Type); AddMapEntry(new Color(67, 72, 81), CreateMapEntryName()); RegisterItemDrop(ModContent.ItemType()); FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); } public override bool CanExplode(int i, int j) => false; public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 226); return false; } public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; } } }