function init(hero) {
    hero.setName("Mr Fantastic");
    hero.setTier(6);
    
  
    hero.setChestplate("item.superhero_armor.piece.jacket");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("fiskheroes:cellular_regeneration","fiskheroes:bullet_immunity",  "pack:cosmicstretch");
       hero.addAttribute("WEAPON_DAMAGE", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 7.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.8, 0);
    hero.addAttribute("PUNCH_DAMAGE", 6, 0);
    hero.addAttribute("SPRINT_SPEED", 0.45, 1);
    
	
	
   hero.addKeyBind("STEEL_TRANSFORM", "Bouncing Form", 1);
    hero.addKeyBindFunc("func_WEB_WINGS", webWingsKey, "Stretchy Glide", 2);
    hero.addKeyBind("TENTACLE_JAB", "Arm Jab", 5);
    hero.addKeyBind("TENTACLE_GRAB", "Arm Grab", 4);
    hero.addKeyBind("TENTACLES", "Elongated Arms", 3);
   

 hero.addAttributeProfile("STEEL", steelProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setModifierEnabled(isModifierEnabled);

}




function webWingsKey(player, manager) {
    if (player.isOnGround() || player.isInWater()) {
        return false;
    }
    
    var flag = player.getData("fiskheroes:gliding");
    
    manager.setDataWithNotify(player, "fiskheroes:gliding", !flag);
    return true;
}





function steelProfile(profile) {
	profile.addAttribute("REACH_DISTANCE", 10.0, 1);
	 profile.addAttribute("PUNCH_DAMAGE", 16, 0);
	  profile.addAttribute("JUMP_HEIGHT", 8.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.5, 1);
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:dyn/steeled") ? "STEEL" : null;
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() == "fiskheroes:transformation" || modifier.name() == "fiskheroes:cooldown" || entity.getData("fiskheroes:dyn/steeled")|| modifier != "fiskheroes:metal_skin";
}
