Files
CalamityModPublic/Tiles/Astral/AstralCrateTile.cs
T
NalydddNobel c1b47d5a60 Tile Map Entries cleanup (part 1)
-Added many entries into "Localization/en-US/Tiles.hjson"
**Note: "Localization/en-US/Mods.CalamityMod.hjson" currently has duplicates for some Map Entries.
-Added Utilities/LocalizationUtils.cs , contains a few helper methods for getting Localized Text instances.
-Updated many Tiles to utilize existing localization values.
**Note: Some tiles may now have altered names, due to their Tile names not matching with their item names previously. (Most notably, Altar of the Accursed)
-Updated Pylons to re-use the text entry from their Item
2023-04-18 17:01:28 -07:00

49 lines
1.4 KiB
C#

using CalamityMod.Dusts;
using CalamityMod.Items.Fishing.AstralCatches;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.Astral
{
public class AstralCrateTile : ModTile
{
public override void SetStaticDefaults()
{
Main.tileSolidTop[Type] = true;
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileTable[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileWaterDeath[Type] = false;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.addTile(Type);
AddMapEntry(new Color(47, 66, 90), CalamityUtils.GetItemName<AstralCrate>());
DustType = ModContent.DustType<AstralBlue>();
}
public override bool CreateDust(int i, int j, ref int type)
{
if (Main.rand.NextBool(2))
{
type = ModContent.DustType<AstralOrange>();
}
else
{
type = ModContent.DustType<AstralBlue>();
}
return true;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
}
}