Files
CalamityModPublic/Tiles/ProfanedChair.cs
T

46 lines
1.7 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles
{
public class ProfanedChair : ModTile
{
public override void SetDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2);
TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 18 };
TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft;
TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture
TileObjectData.newTile.StyleMultiplier = 2; //same as above
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player
TileObjectData.addAlternate(1); //facing right will use the second texture style
TileObjectData.addTile(Type);
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair);
ModTranslation name = CreateMapEntryName();
name.SetDefault("ProfanedChair");
AddMapEntry(new Color(200, 200, 200), name);
dustType = mod.DustType("Sparkle");
disableSmartCursor = true;
adjTiles = new int[]{ TileID.Chairs };
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("ProfanedChair"));
}
}
}