46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.Enums;
|
|
using Terraria.Localization;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles.SunkenSea
|
|
{
|
|
public class TableCoral : ModTile
|
|
{
|
|
int subsheetHeight = 34;
|
|
int subsheetWidth = 108;
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileFrameImportant[Type] = true;
|
|
Main.tileNoAttach[Type] = true;
|
|
Main.tileSolidTop[Type] = true;
|
|
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
|
|
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0);
|
|
TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
|
|
TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0);
|
|
TileObjectData.addAlternate(1);
|
|
TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0);
|
|
TileObjectData.addTile(Type);
|
|
DustType = 253;
|
|
AddMapEntry(new Color(54, 69, 72));
|
|
|
|
base.SetStaticDefaults();
|
|
}
|
|
|
|
public override void NumDust(int i, int j, bool fail, ref int num)
|
|
{
|
|
num = fail ? 1 : 3;
|
|
}
|
|
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
|
{
|
|
int xPos = i % 1;
|
|
int yPos = j % 3;
|
|
frameXOffset = xPos * subsheetWidth;
|
|
frameYOffset = yPos * subsheetHeight;
|
|
}
|
|
}
|
|
}
|