Files
CalamityModPublic/Tiles/Furniture/CorruptionEffigy.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

42 lines
1.5 KiB
C#

using CalamityMod.Buffs.Placeables;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.Furniture
{
public class CorruptionEffigy : ModTile
{
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.Width = 2;
TileObjectData.newTile.Height = 4;
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 };
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.Origin = new Point16(0, 3);
TileObjectData.newTile.UsesCustomCanPlace = true;
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0);
TileObjectData.addTile(Type);
AddMapEntry(new Color(126, 156, 134), CalamityUtils.GetItemName<Items.Placeables.Furniture.CorruptionEffigy>());
}
public override void NearbyEffects(int i, int j, bool closer)
{
Player player = Main.LocalPlayer;
if (player is null)
return;
if (!player.dead && player.active)
player.AddBuff(ModContent.BuffType<CorruptionEffigyBuff>(), 20);
}
}
}