package common.entity.npc;

import common.entity.types.EntityLiving;
import common.rng.Random;
import common.world.World;

public class EntityGoblin extends EntityNPC {
	public EntityGoblin(World worldIn) {
		super(worldIn);
	}

	public boolean isAggressive(Class<? extends EntityNPC> clazz) {
		return clazz == EntityHuman.class || clazz == EntityElf.class || clazz == EntityWoodElf.class || clazz == EntityBloodElf.class;
	}

	public int getBaseHealth(Random rand) {
		return rand.range(8, 12);
	}

    public float getHeightDeviationMin() {
    	return -0.1f;
    }

    public float getHeightDeviationMax() {
    	return 0.1f;
    }
    
    public float getSpeciesBaseSize() {
    	return 1.4f;
    }

	public Alignment getNaturalAlign() {
		return rand.pick(Alignment.CHAOTIC_EVIL, Alignment.EVIL, Alignment.LAWFUL_EVIL);
	}
    
	public int getColor() {
		return 0x309430;
	}
    
//    public boolean canAmbush(EntityLiving entity) {
//    	return true;
//    }

    protected void applyEntityAttributes() {
        super.applyEntityAttributes();
        this.setAttackDamageBase(1);
    }
    
    public boolean canAmbush(EntityLiving entity) {
    	return (float)this.getHealth() >= ((float)this.getMaxHealth() / 3.25f);
    }
}
