-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
68 lines
2.3 KiB
C#
68 lines
2.3 KiB
C#
using CalamityMod.Buffs.Placeables;
|
|
using CalamityMod.Items.Placeables.Furniture;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.Localization;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles.Furniture
|
|
{
|
|
public class YellowCandle : ModTile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileLighted[Type] = true;
|
|
Main.tileFrameImportant[Type] = true;
|
|
Main.tileLavaDeath[Type] = true;
|
|
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2);
|
|
TileObjectData.addTile(Type);
|
|
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
|
|
AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName<SpitefulCandle>());
|
|
AnimationFrameHeight = 34;
|
|
}
|
|
|
|
public override void AnimateTile(ref int frame, ref int frameCounter)
|
|
{
|
|
frameCounter++;
|
|
if (frameCounter >= 6)
|
|
{
|
|
frame = (frame + 1) % 6;
|
|
frameCounter = 0;
|
|
}
|
|
}
|
|
|
|
public override void NearbyEffects(int i, int j, bool closer)
|
|
{
|
|
Player player = Main.LocalPlayer;
|
|
if (player == null || !player.active || player.dead)
|
|
return;
|
|
player.AddBuff(ModContent.BuffType<CirrusYellowCandleBuff>(), 20);
|
|
if (Main.netMode != NetmodeID.MultiplayerClient)
|
|
{
|
|
for (int m = 0; m < Main.maxNPCs; m++)
|
|
{
|
|
if (Main.npc[m].active && !Main.npc[m].friendly)
|
|
{
|
|
Main.npc[m].buffImmune[ModContent.BuffType<CirrusYellowCandleBuff>()] = false;
|
|
if (Main.npc[m].Calamity().DR >= 0.99f)
|
|
{
|
|
Main.npc[m].buffImmune[ModContent.BuffType<CirrusYellowCandleBuff>()] = true;
|
|
}
|
|
Main.npc[m].AddBuff(ModContent.BuffType<CirrusYellowCandleBuff>(), 20, false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
|
{
|
|
r = 0.75f;
|
|
g = 0.75f;
|
|
b = 0.35f;
|
|
}
|
|
}
|
|
}
|