package holo.bolt.entity.hostiles;

import holo.bolt.entity.Entity;
import holo.bolt.entity.EntityHostile;
import holo.bolt.render.RenderEntity;
import holo.bolt.world.World;
import holo.bolt.world.map.tile.Tile;

import org.newdawn.slick.geom.Vector2f;

public class EntityStrongMelee extends EntityHostile
{
	RenderEntity render;
	
	public EntityStrongMelee(float[] position, World world)
	{
		super(position, new float[] {48, 64}, world);
		render = new RenderEntity(this);
	}

	@Override
	public String getTextureLoc()
	{
		return "res/MeleeMob2.png";
	}

	@Override
	public RenderEntity getRender()
	{
		return render;
	}

	@Override
	public void onCollideWithEntity(Entity ent)
	{
		if(ent == this.target)
			ent.damage(this.getAttackDamage(), this.facing.copy().scale(0.1F));
	}
	
	public void attack()
	{
		
	}

	@Override
	public void updateAI(int delta)
	{
		if(this.distanceToEntity(target) < 300)
		{
			this.lookat(target);
			Vector2f vec = this.facing.copy();
			this.addVelocity(vec.scale(0.003F));
		}
	}

	@Override
	public float maxHealth()
	{
		return 6;
	}

	@Override
	public float getAttackDamage()
	{
		return 1.7F;
	}

	@Override
	public void onCollideWithTile(Tile t){}

	@Override
	public int getScoreValue()
	{
		return 250;
	}

}
