function init(hero) {
    hero.setName("Daredevil/Matt Murdock");
    hero.setTier(5);
    
    hero.setHelmet("Mask");
    hero.setChestplate("Chestplate");
    hero.setLeggings("Pants");
    hero.setBoots("Boots");
    
    hero.addPowers("tgheroes:devil");
    hero.addAttribute("PUNCH_DAMAGE", 4.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 2.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.25, 1);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 7.0, 0);

	hero.addKeyBind("BILLY", "Billy Club", 1);	
	hero.addKeyBind("BATTON", "Baton", 2);	
	hero.addKeyBind("SLOW_MOTION", "Heightened Perception", 3);

	hero.addAttributeProfile("BATTON", battonProfile);
    hero.addAttributeProfile("BILLY", billyProfile);
    hero.setAttributeProfile(getProfile);
	hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BATTON", {"types": {"BLUNT": 1.0}});	
	hero.addDamageProfile("BILLY", {"types": {"BLUNT": 1.5}});	
	
	hero.setTickHandler((entity, manager) => {
        if (!entity.getHeldItem().isEmpty()&& entity.getData("tgheroes:dyn/devil_club") ||entity.getData("tgheroes:dyn/devil_batton") ){
		 manager.setData(entity, "tgheroes:dyn/devil_club", false);}
		if (!entity.getHeldItem().isEmpty()&& entity.getData("tgheroes:dyn/devil_batton")||entity.getData("tgheroes:dyn/devil_club") ){
		 manager.setData(entity, "tgheroes:dyn/devil_batton", false);}		
    });
	
	
}

function battonProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 10.0, 0);
    profile.addAttribute("REACH_DISTANCE", 1.5, 0);
}
function billyProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 7.5, 0);
}

function getProfile(entity) {
    if (entity.getData("tgheroes:dyn/devil_club")) {
        return "BILLY";
    }
    else if (entity.getData("tgheroes:dyn/devil_batton")) {
        return "BATTON";
    }
    return true;
}



