package common.entity.npc;

import common.ai.AIFireballAttack;
import common.entity.DamageSource;
import common.entity.effect.EntityLightning;
import common.rng.Random;
import common.world.World;

public class EntityFireDemon extends EntityFlyingNPC {
	public EntityFireDemon(World worldIn) {
		super(worldIn);
//		this.setSize(2.55f);
		this.tasks.addTask(7, new AIFireballAttack(this, 3, 7, 64.0, 2.0));
	}

//	public boolean isAggressive() {
//		return true;
//	}
//
//	public boolean isPeaceful() {
//		return false;
//	}

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

	public boolean isPeaceful(Class<? extends EntityNPC> clazz) {
		return clazz == EntityDarkMage.class;
	}

//	public boolean canInfight(Alignment align) {
//		return false;
//	}
//
//	public boolean canMurder(Alignment align) {
//		return false;
//	}

	public boolean canUseMagic() {
		return true;
	}

	public int getBaseHealth(Random rand) {
		return rand.range(56, 140);
	}

//	public int getBaseEnergy(Random rand) {
//		return 0;
//	}

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

    public float getHeightDeviationMax() {
    	return 0.35f;
    }
    
    public float getSpeciesBaseSize() {
    	return 2.55f;
    }

	public Alignment getNaturalAlign() {
		return Alignment.CHAOTIC_EVIL;
	}

	public boolean isImmuneToFire() {
		return true;
	}

	public int getColor() {
		return 0xa2371b;
	}
    
    public boolean hasPowerRods() {
        return true;
    }
    
    public boolean attackEntityFrom(DamageSource source, int amount) {
    	if(source.isExplosion())
    		return false;
    	return super.attackEntityFrom(source, amount);
    }
    
	public void onStruckByLightning(EntityLightning lightningBolt) {
	}
    
//    public boolean canAmbush(EntityLiving entity) {
//    	return true; // this.getHealth() >= this.getMaxHealth() / 8;
//    }
}
