package holo.bolt.world.map.tile;

import holo.bolt.entity.Entity;
import holo.bolt.entity.EntityPlayer;
import holo.bolt.render.Render;
import holo.bolt.render.RenderInteractableTile;

public class TileHealingWell extends InteractableTile
{
	public int used;
	public TileHealingWell(float[] position)
	{
		super(position);
		used = 0;
	}

	@Override
	public int getTileID()
	{
		return 2;
	}

	@Override
	public boolean collidable()
	{
		return true;
	}

	@Override
	public Render getRenderer()
	{
		return new RenderInteractableTile(this);
	}

	@Override
	public String textureLoc()
	{
		return "res/HealingWell.png";
	}

	@Override
	public String textureLoc2()
	{
		return "res/HealingWellUsed.png";
	}

	@Override
	public void onCollideWithEntity(Entity entity)
	{
		
	}
	
	public float healAmount()
	{
		return 3;
	}

	@Override
	public int uses()
	{
		return 3;
	}

	@Override
	public int used()
	{
		return used;
	}

	@Override
	public void performUse(EntityPlayer player)
	{
		if(this.used < uses())
		{
			player.heal(this.healAmount());
			++this.used;
		}
	}

	@Override
	public String getDescription()
	{
		return "Heal " + healAmount() + " life.";
	}
}
