function init(hero) {
    hero.setName("Vampire");
    hero.setTier(8);
    
    hero.setHelmet("Fangs");
   
    hero.addPowers("shadows:vampire");
    hero.addAttribute("FALL_RESISTANCE", 1, 1);
    hero.addAttribute("JUMP_HEIGHT", 5, 0);
    hero.addAttribute("PUNCH_DAMAGE", 5, 0);
    hero.addAttribute("SPRINT_SPEED", 0.5, 1);
    hero.addAttribute("STEP_HEIGHT", 1, 0);
    hero.addAttribute("BASE_SPEED_LEVELS", 4, 0);

    
    hero.addKeyBind("SUPER_SPEED", "Speed", 4);
    hero.addKeyBind("SHADOWFORM", "key.shadowForm", 1);
    hero.addKeyBind("AIM", "key.shadowChain", 2);
    hero.addKeyBind("SLOW_MOTION", "key.slowMotion", 2);
    hero.addKeyBind("TELEKINESIS", "key.shadowChain", 2);
    hero.addKeyBind("ENERGY_PROJECTION", "Blood Shadow Beam", 3);	
    hero.addKeyBind("CHARGED_BEAM", "Bite", 5);
	
	
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:flight":
        return entity.getData("fiskheroes:shadowform");
    case "fiskheroes:telekinesis":
        return entity.getHeldItem().isEmpty() && !entity.getData("fiskheroes:shadowform") && !entity.getData("fiskheroes:lightsout");
	case "fiskheroes:slow_motion":
	    return entity.getData("fiskheroes:speeding");
	case "fiskheroes:super_speed":
	    return !entity.getData("fiskheroes:shadowform");
    default:
        return true;
    }
}
function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
        case "SLOW_MOTION":
            return entity.getData("fiskheroes:speeding");
		case "SHADOWFORM":
            return !entity.getData("fiskheroes:speeding");
		case "TELEKINESIS":
            return !entity.getData("fiskheroes:speeding") && !entity.getData("fiskheroes:shadowform");
		case "AIM":
            return !entity.getData("fiskheroes:speeding") && !entity.getData("fiskheroes:shadowform");
	    case "SUPER_SPEED":
	        return !entity.getData("fiskheroes:shadowform");
	    case "ENERGY_PROJECTION":
	        return !entity.getData("fiskheroes:shadowform") && !entity.getData("fiskheroes:telekinesis");
        case "CHARGED_BEAM":
            return !entity.getData("fiskheroes:shadowform") && !entity.getData("fiskheroes:telekinesis") && entity.getHeldItem().isEmpty()&& entity.motionX() == 0 && entity.motionZ() == 0 && entity.isOnGround();		
        default:
            return true;
    }
}

function canAim(entity) {
    return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:grab_id") > -1;
}

