55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles
|
|
{
|
|
public class DraedonsForge : ModTile
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
animationFrameHeight = 36;
|
|
Main.tileLighted[Type] = true;
|
|
Main.tileFrameImportant[Type] = true;
|
|
Main.tileNoAttach[Type] = true;
|
|
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
|
|
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 };
|
|
TileObjectData.addTile(Type);
|
|
ModTranslation name = CreateMapEntryName();
|
|
name.SetDefault("Draedon's Forge");
|
|
AddMapEntry(new Color(0, 255, 0), name);
|
|
disableSmartCursor = true;
|
|
adjTiles = new int[] { TileID.Anvils, TileID.Furnaces, TileID.WorkBenches, TileID.LunarCraftingStation,
|
|
TileID.MythrilAnvil, TileID.AdamantiteForge, TileID.Hellforge };
|
|
}
|
|
|
|
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
|
{
|
|
Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("DraedonsForge"));
|
|
}
|
|
|
|
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
|
{
|
|
r = (float)Main.DiscoR / 255f;
|
|
g = (float)Main.DiscoG / 255f;
|
|
b = (float)Main.DiscoB / 255f;
|
|
}
|
|
|
|
public override void AnimateTile(ref int frame, ref int frameCounter)
|
|
{
|
|
frameCounter++;
|
|
if (frameCounter > 12)
|
|
{
|
|
frameCounter = 0;
|
|
frame++;
|
|
if (frame > 3)
|
|
{
|
|
frame = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|