function init(hero) {
    hero.setName("Thor");
    hero.setTier(8);
    
    hero.setHelmet("Helmet");
    hero.setChestplate("Chestplate");
    hero.setLeggings("Pants");
    hero.setBoots("Boots");
    
    hero.addPowers("tgheroes:thor_p");
    hero.addAttribute("PUNCH_DAMAGE", 6.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 2.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.5, 1);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 1.0, 1);

    hero.addKeyBind("BLADE", "Mjolnir", 1);
	hero.addKeyBind("CHARGED_BEAM", "Charged Strike", 2);
		
    hero.addAttributeProfile("BLADE", mjolnerProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BLADE", {"types": {"BLUNT": 1.0}});	

    hero.setKeyBindEnabled(isKeyBindEnabled);
	hero.setModifierEnabled(isModifierEnabled);
}

function mjolnerProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 14, 0);
}

function getProfile(entity) {
    return entity.getData("fiskheroes:blade") ? "BLADE" : null;
}

function isKeyBindEnabled(entity, keyBind) {  
	switch (keyBind) {
    case "BLADE":
        return entity.getHeldItem().isEmpty();
        case "CHARGED_BEAM":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:blade");
		
    default:
        return true;
    }
}

function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:controlled_flight") {
        return entity.getData("fiskheroes:blade");
	}
	else if (modifier.name() == "fiskheroes:lightning_cast") {
		return entity.getData("fiskheroes:blade");
	}
	else if (modifier.name() == "fiskheroes:charged_beam") {
		return entity.getData("fiskheroes:blade");
	}
    return true;
}