-
Notifications
You must be signed in to change notification settings - Fork 8
/
LivingHellstoneGlobalItem.cs
38 lines (34 loc) · 1.22 KB
/
LivingHellstoneGlobalItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using MechTransfer.Tiles;
using Terraria;
using Terraria.ModLoader;
namespace MechTransfer
{
internal class LivingHellstoneGlobalItem : GlobalItem
{
private int burnTime = 0;
public override bool InstancePerEntity { get { return true; } }
public override bool CloneNewInstances { get { return true; } }
public override void Update(Item item, ref float gravity, ref float maxFallSpeed)
{
if (item.type == mod.PlaceItemType<LivingHellstoneTile>())
return;
foreach (var p in Collision.GetEntityEdgeTiles(item))
{
if (p.X > 0 && p.X < Main.maxTilesX && p.Y > 0 && p.Y < Main.maxTilesY &&
Main.tile[p.X, p.Y].active() && Main.tile[p.X, p.Y].type == ModContent.TileType<LivingHellstoneTile>())
{
if (++burnTime > 0)
{
Dust.NewDust(item.position, item.width, item.height, 6);
}
if (burnTime > 60)
{
item.active = false;
}
return;
}
}
burnTime = 0;
}
}
}