92 lines
3.4 KiB
C#
92 lines
3.4 KiB
C#
using Decimation.Items;
|
|
using Decimation.Items.Boss.Arachnus;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Decimation.Items.Placeable.ShrineoftheMoltenOne;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.Enums;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace Decimation.Tiles.ShrineoftheMoltenOne
|
|
{
|
|
class LockedShrineDoor : ModTile
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
Main.tileFrameImportant[Type] = true;
|
|
Main.tileBlockLight[Type] = true;
|
|
Main.tileSolid[Type] = true;
|
|
Main.tileNoAttach[Type] = true;
|
|
Main.tileLavaDeath[Type] = false;
|
|
TileID.Sets.NotReallySolid[Type] = true;
|
|
TileID.Sets.DrawsWalls[Type] = true;
|
|
TileID.Sets.HasOutlines[Type] = true;
|
|
TileObjectData.newTile.Width = 1;
|
|
TileObjectData.newTile.Height = 3;
|
|
TileObjectData.newTile.Origin = new Point16(0, 0);
|
|
TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
|
|
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
|
|
TileObjectData.newTile.UsesCustomCanPlace = true;
|
|
TileObjectData.newTile.LavaDeath = true;
|
|
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
|
TileObjectData.newTile.CoordinateWidth = 16;
|
|
TileObjectData.newTile.CoordinatePadding = 2;
|
|
TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
|
|
TileObjectData.newAlternate.Origin = new Point16(0, 1);
|
|
TileObjectData.addAlternate(0);
|
|
TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
|
|
TileObjectData.newAlternate.Origin = new Point16(0, 2);
|
|
TileObjectData.addAlternate(0);
|
|
TileObjectData.addTile(Type);
|
|
ModTranslation name = CreateMapEntryName();
|
|
name.SetDefault("Shrine Door");
|
|
AddMapEntry(new Color(33, 28, 25), name);
|
|
dustType = DustID.Stone;
|
|
disableSmartCursor = true;
|
|
}
|
|
|
|
public override bool HasSmartInteract()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override void NumDust(int i, int j, bool fail, ref int num)
|
|
{
|
|
num = 1;
|
|
}
|
|
|
|
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
|
{
|
|
Item.NewItem(i * 16, j * 16, 16, 48, ModContent.ItemType<ShrineDoor>());
|
|
}
|
|
|
|
public override void MouseOver(int i, int j)
|
|
{
|
|
Player player = Main.LocalPlayer;
|
|
player.noThrow = 2;
|
|
player.showItemIcon = true;
|
|
player.showItemIcon2 = ModContent.ItemType<MoltenKey>();
|
|
}
|
|
|
|
public override bool CanKillTile(int i, int j, ref bool blockDamaged)
|
|
{
|
|
return DecimationWorld.downedArachnus;
|
|
}
|
|
|
|
public override void RightClick(int i, int j)
|
|
{
|
|
bool inventoryContainKey = false;
|
|
|
|
foreach (Item item in Main.LocalPlayer.inventory)
|
|
if (item.type == ModContent.ItemType<MoltenKey>())
|
|
inventoryContainKey = true;
|
|
|
|
if (inventoryContainKey)
|
|
Main.tile[i, j].type = (ushort)ModContent.TileType<ShrineDoorClosed>();
|
|
}
|
|
}
|
|
}
|