Placeable rock.
This commit is contained in:
1 parent
b597126cd9
commit
4286cc3b27
3 files changed
+49
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Tiles;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items
|
||||
@@ -16,6 +18,13 @@ namespace CalamityMod.Items
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 0, 0, 1);
|
||||
item.createTile = ModContent.TileType<PlacedRock>();
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTurn = true;
|
||||
item.useAnimation = 15;
|
||||
item.useTime = 10;
|
||||
item.autoReuse = true;
|
||||
item.consumable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using CalamityMod.Items;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
public class PlacedRock : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
dustType = DustID.Stone;
|
||||
drop = ModContent.ItemType<Rock>();
|
||||
|
||||
AddMapEntry(new Color(83, 91, 102));
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 213 B |
Reference in new issue
Block a user