- Resprited some buffs/debuffs - Changed colors for Donor Item/Enchantment tooltip text Porting info - Sand placement fix - Better prefix support for 1.4.4 Excalibur and co - Toggled tile drop fixes - Fixed hostile damage being set to 1 - Made the parry damage reduction work as it is supposed to
74 lines
2.3 KiB
C#
74 lines
2.3 KiB
C#
using CalamityMod.Items.Placeables.Furniture;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.DataStructures;
|
|
using Terraria.GameContent.Events;
|
|
using Terraria.GameContent.ObjectInteractions;
|
|
using Terraria.ID;
|
|
using Terraria.Localization;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles.Furniture
|
|
{
|
|
public class LanternCenterTile : ModTile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileFrameImportant[Type] = true;
|
|
|
|
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
|
|
TileObjectData.newTile.DrawYOffset = 2;
|
|
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 18 };
|
|
TileObjectData.newTile.StyleLineSkip = 2;
|
|
TileObjectData.addTile(Type);
|
|
AddMapEntry(new Color(99, 99, 99), CalamityUtils.GetItemName<LanternCenter>());
|
|
TileID.Sets.HasOutlines[Type] = true;
|
|
|
|
AnimationFrameHeight = 54;
|
|
}
|
|
|
|
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
|
|
|
public override bool CreateDust(int i, int j, ref int type) => false;
|
|
|
|
public override void AnimateTile(ref int frame, ref int frameCounter)
|
|
{
|
|
frameCounter++;
|
|
if (frameCounter >= 6)
|
|
{
|
|
frame = (frame + 1) % 6;
|
|
frameCounter = 0;
|
|
}
|
|
}
|
|
|
|
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
|
{
|
|
LanternNight.ManualLanterns = false;
|
|
}
|
|
|
|
public override void HitWire(int i, int j)
|
|
{
|
|
CalamityUtils.LightHitWire(Type, i, j, 3, 3);
|
|
LanternNight.ToggleManualLanterns();
|
|
}
|
|
|
|
public override bool RightClick(int i, int j)
|
|
{
|
|
CalamityUtils.LightHitWire(Type, i, j, 3, 3);
|
|
LanternNight.ToggleManualLanterns();
|
|
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
|
return true;
|
|
}
|
|
|
|
public override void MouseOver(int i, int j)
|
|
{
|
|
Player player = Main.LocalPlayer;
|
|
player.noThrow = 2;
|
|
player.cursorItemIconEnabled = true;
|
|
player.cursorItemIconID = ModContent.ItemType<LanternCenter>();
|
|
}
|
|
}
|
|
}
|