56 lines
1.9 KiB
C#
56 lines
1.9 KiB
C#
using CalamityMod.Dusts.Furniture;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles.FurnitureBotanic
|
|
{
|
|
public class BotanicPlanter : ModTile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileLighted[Type] = true;
|
|
Main.tileFrameImportant[Type] = true;
|
|
Main.tileLavaDeath[Type] = false;
|
|
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
|
|
TileObjectData.newTile.LavaDeath = false;
|
|
TileObjectData.newTile.StyleLineSkip = 2;
|
|
TileObjectData.addTile(Type);
|
|
AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName<Items.Placeables.FurnitureBotanic.BotanicPlanter>());
|
|
AnimationFrameHeight = 54;
|
|
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
|
|
}
|
|
|
|
public override bool CreateDust(int i, int j, ref int type)
|
|
{
|
|
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType<BloomTileGold>(), 0f, 0f, 1, new Color(255, 255, 255), 1f);
|
|
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType<BloomTileLeaves>(), 0f, 0f, 1, new Color(255, 255, 255), 1f);
|
|
return false;
|
|
}
|
|
|
|
public override void NumDust(int i, int j, bool fail, ref int num)
|
|
{
|
|
num = fail ? 1 : 3;
|
|
}
|
|
|
|
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
|
{
|
|
Tile tile = Main.tile[i, j];
|
|
//227 79 79
|
|
if (tile.TileFrameX < 54)
|
|
{
|
|
r = 0.8f;
|
|
g = 0.9f;
|
|
b = 0.3f;
|
|
}
|
|
}
|
|
|
|
public override void HitWire(int i, int j)
|
|
{
|
|
FurnitureCommon.LightHitWire(Type, i, j, 3, 3);
|
|
}
|
|
}
|
|
}
|