package common.entity.npc;

import common.entity.types.EntityLiving;
import common.init.Items;
import common.init.NameRegistry;
import common.item.ItemStack;
import common.rng.Random;
import common.world.World;

public class EntityWoodElf extends EntityNPC {
	public EntityWoodElf(World worldIn) {
		super(worldIn);
	}
	
//	public boolean isAggressive() {
//		return false;
//	}
//	
//    public boolean isPeaceful() {
//    	return false;
//    }
    
//    public boolean isAggressive(Class<? extends EntityNPC> clazz) {
//    	return false;
//    }
    
    public boolean isPeaceful(Class<? extends EntityNPC> clazz) {
    	return clazz == EntityElf.class || clazz == EntityBloodElf.class;
    }
    
//    public boolean canInfight(Alignment align) {
//    	return false;
//    }
//    
//    public boolean canMurder(Alignment align) {
//    	return false;
//    }
    
    public boolean canUseMagic() {
    	return true;
    }
    
//    public int getBaseEnergy(Random rand) {
//    	return rand.range(2, 4);
//    }
    
    public int getBaseHealth(Random rand) {
    	return rand.range(20, 22);
    }

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

    public float getHeightDeviationMax() {
    	return 0.25f;
    }
    
    public float getSpeciesBaseSize() {
    	return 1.75f;
    }
    
    public Alignment getNaturalAlign() {
    	return rand.chance(5) ? (rand.chance(5) ? Alignment.CHAOTIC : Alignment.NEUTRAL) : Alignment.LAWFUL;
    }
    
    public NameRegistry getNameType() {
        return NameRegistry.ELVEN;
    }
    
    public boolean canAmbush(EntityLiving entity) {
    	return (float)this.getHealth() >= ((float)this.getMaxHealth() / 3.0f);
    }

	protected ItemStack pickItem() {
		return this.rand.chance(null, new ItemStack(Items.bow), 3);
	}
}
