package common.entity.npc;

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

public class EntityBloodElf extends EntityNPC {
	public EntityBloodElf(World worldIn) {
		super(worldIn);
	}
	
//	public boolean isAggressive() {
//		return this.alignment.evil && !this.alignment.lawful;
//	}
//	
//    public boolean isPeaceful() {
//    	return false;
//    }
    
    public boolean isAggressive(Class<? extends EntityNPC> clazz) {
    	return (this.alignment.evil && !this.alignment.lawful) || clazz == EntityCultivator.class;
    }
    
    public boolean isPeaceful(Class<? extends EntityNPC> clazz) {
    	return !this.alignment.evil && clazz == EntityWoodElf.class;
    }
    
//    public boolean canInfight(Alignment align) {
//    	return this.alignment.chaotic;
//    }
//    
//    public boolean canMurder(Alignment align) {
//    	return false;
//    }
    
    public boolean canUseMagic() {
    	return true;
    }
    
//    public int getBaseEnergy(Random rand) {
//    	return rand.range(12, 28);
//    }
    
    public int getBaseHealth(Random rand) {
    	return rand.range(24, 26);
    }

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

    public float getHeightDeviationMax() {
    	return 0.3f;
    }
    
    public float getSpeciesBaseSize() {
    	return 1.9f;
    }
    
    public Alignment getNaturalAlign() {
    	return rand.chance(50) ? 
    			(rand.chance(8) ? (rand.chance(5) ? Alignment.CHAOTIC : Alignment.LAWFUL) : Alignment.NEUTRAL) : 
    			(rand.chance(5) ? Alignment.EVIL : Alignment.LAWFUL_EVIL);
    }
    
    public NameRegistry getNameType() {
        return NameRegistry.ELVEN;
    }

	protected ItemStack pickItem() {
		return new ItemStack(this.rand.chance(4) ? this.rand.pick(Items.bow, Items.stone_sword) : Items.iron_sword);
	}
}
